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

Core/REST/Client/Values/Content/ContentCreateStruct.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\REST\Client\Values\Content;
8
9 use eZ\Publish\API\Repository\Values\Content\Field;
10 use eZ\Publish\API\Repository\Values\Content\ContentCreateStruct as APIContentCreateStruct;
11
18 class ContentCreateStruct extends APIContentCreateStruct
19 {
21 protected $fields = array();
22
35 public function setField($fieldDefIdentifier, $value, $language = null)
36 {
37 if (null === $language && $this->contentType->getFieldDefinition($fieldDefIdentifier)->isTranslatable) {
38 $language = $this->mainLanguageCode;
39 }
40
41 $this->fields[] = new Field(
42 array(
43 'fieldDefIdentifier' => $fieldDefIdentifier,
44 'value' => $value,
45 'languageCode' => $language,
46 )
47 );
48 }
49 }
eZ\Publish\API\Repository\Values\Content\ContentCreateStruct
Definition: API/Repository/Values/Content/ContentCreateStruct.php:15
eZ\Publish\API\Repository\Values\Content\ContentCreateStruct\$mainLanguageCode
$mainLanguageCode
Definition: API/Repository/Values/Content/ContentCreateStruct.php:65
eZ\Publish\API\Repository\Values\Content\Field
Definition: API/Repository/Values/Content/Field.php:21
eZ\Publish\Core\REST\Client\Values\Content\ContentCreateStruct
Implementation of the \eZ\Publish\API\Repository\Values\Content\ContentCreateStruct class.
Definition: Core/REST/Client/Values/Content/ContentCreateStruct.php:19
eZ\Publish\Core\REST\Client\Values\Content\ContentCreateStruct\setField
setField($fieldDefIdentifier, $value, $language=null)
Adds a field to the field collection.
Definition: Core/REST/Client/Values/Content/ContentCreateStruct.php:35
eZ\Publish\Core\REST\Client\Values\Content\ContentCreateStruct\$fields
$fields
Definition: Core/REST/Client/Values/Content/ContentCreateStruct.php:21
eZ\Publish\Core\REST\Client\Values\Content
Definition: Publish/Core/REST/Client/Values/Content/Content.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.