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

Core/Repository/Values/Content/ContentCreateStruct.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Repository\Values\Content;
8
9 use eZ\Publish\API\Repository\Values\Content\ContentCreateStruct as APIContentCreateStruct;
10 use eZ\Publish\API\Repository\Values\Content\Field;
11
19 class ContentCreateStruct extends APIContentCreateStruct
20 {
26 public $fields = [];
27
40 public function setField($fieldDefIdentifier, $value, $language = null)
41 {
42 if (!isset($language)) {
43 $language = $this->mainLanguageCode;
44 }
45
46 $this->fields[] = new Field(
47 [
48 'fieldDefIdentifier' => $fieldDefIdentifier,
49 'value' => $value,
50 'languageCode' => $language,
51 ]
52 );
53 }
54 }
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\Repository\Values\Content\ContentCreateStruct
Definition: Core/Repository/Values/Content/ContentCreateStruct.php:20
eZ\Publish\Core\Repository\Values\Content\ContentCreateStruct\setField
setField($fieldDefIdentifier, $value, $language=null)
Adds a field to the field collection.
Definition: Core/Repository/Values/Content/ContentCreateStruct.php:40
eZ\Publish\Core\Repository\Values\Content\ContentCreateStruct\$fields
$fields
Definition: Core/Repository/Values/Content/ContentCreateStruct.php:26
eZ\Publish\Core\Repository\Values\Content
Definition: Publish/Core/Repository/Values/Content/Content.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.