Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Core/REST/Client/Values/ContentType/ContentType.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\REST\Client\Values\ContentType;
8
9 use eZ\Publish\Core\Repository\Values\MultiLanguageDescriptionTrait;
10 use eZ\Publish\Core\Repository\Values\MultiLanguageNameTrait;
11 use eZ\Publish\Core\Repository\Values\MultiLanguageTrait;
12 use eZ\Publish\Core\REST\Client\ContentTypeService;
13 use eZ\Publish\API\Repository\Values\ContentType\ContentType as APIContentType;
14
42 class ContentType extends APIContentType
43 {
44 use MultiLanguageTrait;
45 use MultiLanguageNameTrait;
46 use MultiLanguageDescriptionTrait;
47
53 protected $contentTypeService;
54
60 protected $fieldDefinitionListReference;
61
67 protected $contentTypeGroupListReference;
68
73 public function __construct(ContentTypeService $contentTypeService, array $data = array())
74 {
75 $this->contentTypeService = $contentTypeService;
76 parent::__construct($data);
77 }
78
84 public function getContentTypeGroups()
85 {
86 $contentTypeGroupList = $this->contentTypeService->loadContentTypeGroupList(
87 $this->contentTypeGroupListReference
88 );
89
90 return $contentTypeGroupList->getContentTypeGroups();
91 }
92
98 public function getFieldDefinitions()
99 {
100 $fieldDefinitionList = $this->contentTypeService->loadFieldDefinitionList(
101 $this->fieldDefinitionListReference
102 );
103
104 return $fieldDefinitionList->getFieldDefinitions();
105 }
106
114 public function getFieldDefinition($fieldDefinitionIdentifier)
115 {
116 $fieldDefinitions = $this->getFieldDefinitions();
117 foreach ($fieldDefinitions as $fieldDefinition) {
118 if ($fieldDefinition->identifier === $fieldDefinitionIdentifier) {
119 return $fieldDefinition;
120 }
121 }
122
123 return null;
124 }
125
133 public function __get($property)
134 {
135 switch ($property) {
136 case 'contentTypeGroups':
137 return $this->getContentTypeGroups();
138 }
139
140 return parent::__get($property);
141 }
142
150 public function __isset($property)
151 {
152 if ($property === 'contentTypeGroups') {
153 return true;
154 }
155
156 return parent::__isset($property);
157 }
158 }
eZ\Publish\API\Repository\Values\ContentType\ContentType
Definition: API/Repository/Values/ContentType/ContentType.php:36
eZ\Publish\Core\REST\Client\ContentTypeService
Definition: Core/REST/Client/ContentTypeService.php:36
eZ\Publish\Core\REST\Client\Values\ContentType\ContentType\__construct
__construct(ContentTypeService $contentTypeService, array $data=array())
Definition: Core/REST/Client/Values/ContentType/ContentType.php:73
eZ\Publish\Core\REST\Client\Values\ContentType\ContentType\getContentTypeGroups
getContentTypeGroups()
This method returns the content type groups this content type is assigned to.
Definition: Core/REST/Client/Values/ContentType/ContentType.php:84
eZ\Publish\Core\REST\Client\Values\ContentType\ContentType\getFieldDefinitions
getFieldDefinitions()
This method returns the content type field definitions from this type.
Definition: Core/REST/Client/Values/ContentType/ContentType.php:98
eZ\Publish\Core\REST\Client\Values\ContentType\ContentType\__isset
__isset($property)
Magic isset for signaling existence of convenience properties.
Definition: Core/REST/Client/Values/ContentType/ContentType.php:150
eZ\Publish\Core\REST\Client\Values\ContentType\ContentType\__get
__get($property)
Magic getter for retrieving convenience properties.
Definition: Core/REST/Client/Values/ContentType/ContentType.php:133
eZ\Publish\Core\REST\Client\Values\ContentType\ContentType\$fieldDefinitionListReference
$fieldDefinitionListReference
Definition: Core/REST/Client/Values/ContentType/ContentType.php:60
eZ\Publish\Core\REST\Client\Values\ContentType\ContentType\$contentTypeService
$contentTypeService
Definition: Core/REST/Client/Values/ContentType/ContentType.php:53
eZ\Publish\Core\REST\Client\Values\ContentType\ContentType\$contentTypeGroupListReference
$contentTypeGroupListReference
Definition: Core/REST/Client/Values/ContentType/ContentType.php:67
eZ\Publish\Core\REST\Client\Values\ContentType\ContentType\getFieldDefinition
getFieldDefinition($fieldDefinitionIdentifier)
This method returns the field definition for the given identifier.
Definition: Core/REST/Client/Values/ContentType/ContentType.php:114
eZ\Publish\Core\REST\Client\Values\ContentType
Definition: Core/REST/Client/Values/ContentType/ContentType.php:7
eZ\Publish\SPI\Persistence\Content\Type
Definition: SPI/Persistence/Content/Type/CreateStruct.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.