Class

eZ\Publish\API\Repository\Values\Content\ContentCreateStruct

abstract class ContentCreateStruct extends ContentStruct

This class is used for creating a new content object.

Properties

Field[] $fields \eZ\Publish\API\Repository\Values\Content\Field[]$fields
ContentType $contentType The content type for which the new content is created.
mixed $sectionId The section the content is assigned to.
mixed $ownerId The owner of the content.
bool $alwaysAvailable Indicates if the content object is shown in the mainlanguage if its not present in an other requested language.
string $remoteId Remote identifier used as a custom identifier for the object.
string $mainLanguageCode the main language code for the content.
DateTime $modificationDate Modification date.

Methods

setField(string $fieldDefIdentifier, mixed $value, string|null $language = null)

Adds a field to the field collection.

from ContentStruct

Details

in ContentStruct at line 31
abstract public setField(string $fieldDefIdentifier, mixed $value, string|null $language = null)

Adds a field to the field collection.

This method could also be implemented by a magic setter so that $fields[$fieldDefIdentifier][$language] = $value or without language $fields[$fieldDefIdentifier] = $value is an equivalent call.

Parameters

string $fieldDefIdentifier the identifier of the field definition
mixed $value Either a plain value which is understandable by the corresponding field type or an instance of a Value class provided by the field type
string|null $language If not given on a translatable field the initial language is used