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

Publish/Core/Repository/Values/User/User.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Repository\Values\User;
8
9 use eZ\Publish\API\Repository\Values\User\User as APIUser;
10 use eZ\Publish\API\Repository\Values\ContentType\ContentType;
11
17 class User extends APIUser
18 {
24 protected $content;
25
31 public function getVersionInfo()
32 {
33 return $this->content->getVersionInfo();
34 }
35
36 public function getContentType(): ContentType
37 {
38 return $this->content->getContentType();
39 }
40
53 public function getFieldValue($fieldDefIdentifier, $languageCode = null)
54 {
55 return $this->content->getFieldValue($fieldDefIdentifier, $languageCode);
56 }
57
63 public function getFields()
64 {
65 return $this->content->getFields();
66 }
67
77 public function getFieldsByLanguage($languageCode = null)
78 {
79 return $this->content->getFieldsByLanguage($languageCode);
80 }
81
92 public function getField($fieldDefIdentifier, $languageCode = null)
93 {
94 return $this->content->getField($fieldDefIdentifier, $languageCode);
95 }
96
108 protected function getProperties($dynamicProperties = ['id', 'contentInfo', 'versionInfo', 'fields'])
109 {
110 return parent::getProperties($dynamicProperties);
111 }
112
120 public function __get($property)
121 {
122 switch ($property) {
123 case 'contentInfo':
124 return $this->getVersionInfo()->getContentInfo();
125
126 case 'id':
127 return $this->getVersionInfo()->getContentInfo()->id;
128
129 case 'versionInfo':
130 return $this->getVersionInfo();
131
132 case 'fields':
133 return $this->getFields();
134
135 case 'content':
136 // trigger error for this, but for BC let it pass on to normal __get lookup for now
137 @trigger_error(
138 sprintf('%s is and internal property, usage is deprecated as of 6.10. User itself exposes everything needed.', $property),
139 E_USER_DEPRECATED
140 );
141 }
142
143 return parent::__get($property);
144 }
145
153 public function __isset($property)
154 {
155 if ($property === 'contentInfo') {
156 return true;
157 }
158
159 if ($property === 'id') {
160 return true;
161 }
162
163 if ($property === 'versionInfo') {
164 return true;
165 }
166
167 if ($property === 'fields') {
168 return true;
169 }
170
171 return parent::__isset($property);
172 }
173 }
eZ\Publish\API\Repository\Values\ContentType\ContentType
Definition: API/Repository/Values/ContentType/ContentType.php:36
eZ\Publish\API\Repository\Values\User\User
Definition: Publish/API/Repository/Values/User/User.php:24
eZ\Publish\Core\Repository\Values\User\User
This class represents a user value.
Definition: Publish/Core/Repository/Values/User/User.php:18
eZ\Publish\Core\Repository\Values\User\User\__get
__get($property)
Magic getter for retrieving convenience properties.
Definition: Publish/Core/Repository/Values/User/User.php:120
eZ\Publish\Core\Repository\Values\User\User\getFieldsByLanguage
getFieldsByLanguage($languageCode=null)
This method returns the fields for a given language and non translatable fields.
Definition: Publish/Core/Repository/Values/User/User.php:77
eZ\Publish\Core\Repository\Values\User\User\getVersionInfo
getVersionInfo()
Returns the VersionInfo for this version.
Definition: Publish/Core/Repository/Values/User/User.php:31
eZ\Publish\Core\Repository\Values\User\User\getFieldValue
getFieldValue($fieldDefIdentifier, $languageCode=null)
Returns a field value for the given value $version->fields[$fieldDefId][$languageCode] is an equivale...
Definition: Publish/Core/Repository/Values/User/User.php:53
eZ\Publish\Core\Repository\Values\User\User\getField
getField($fieldDefIdentifier, $languageCode=null)
This method returns the field for a given field definition identifier and language.
Definition: Publish/Core/Repository/Values/User/User.php:92
eZ\Publish\Core\Repository\Values\User\User\$content
$content
Definition: Publish/Core/Repository/Values/User/User.php:24
eZ\Publish\Core\Repository\Values\User\User\getProperties
getProperties($dynamicProperties=['id', 'contentInfo', 'versionInfo', 'fields'])
Function where list of properties are returned.
Definition: Publish/Core/Repository/Values/User/User.php:108
eZ\Publish\Core\Repository\Values\User\User\getFields
getFields()
This method returns the complete fields collection.
Definition: Publish/Core/Repository/Values/User/User.php:63
eZ\Publish\Core\Repository\Values\User\User\getContentType
getContentType()
Returns the ContentType for this content.
Definition: Publish/Core/Repository/Values/User/User.php:36
eZ\Publish\Core\Repository\Values\User\User\__isset
__isset($property)
Magic isset for signaling existence of convenience properties.
Definition: Publish/Core/Repository/Values/User/User.php:153
eZ\Publish\Core\Repository\Values\User
Definition: Core/Repository/Values/User/Policy.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+.