This class is used for updating the fields of a content object draft.
Properties¶
$creatorId¶
Creator user ID.
|
|
Creator of the version, in the search API this is referred to as the modifier of the published content.
WARNING: Standard permission rules applies, only the user set here will be able to change the draft after being set as modifier, and only if (s)he has access to edit the draft in the first place.
Optional creator of version, current user will be used if null
$fields¶
|
|
$fields¶
|
|
$initialLanguageCode¶
The language code of the version. In 4.x this code will be used as the language code of the translation (which is shown in the admin interface).
|
|
It is also used as default language for added fields.
Methods¶
__construct() ¶
Construct object optionally with a set of properties.
|
|
Readonly properties values must be set using $properties as they are not writable anymore after object has been created.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$properties | array<string|int, mixed> | [] | - |
setField() ¶
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
Name | Type | Default value | Description |
---|---|---|---|
$fieldDefIdentifier | string | - |
the identifier of the field definition |
$value | mixed | - |
Either a plain value which is understandable by the corresponding field type or an instance of a Value class provided by the field type |
$language | string|null | null |
If not given on a translatable field the initial language is used |
getProperties() ¶
Function where list of properties are returned.
|
|
Used by attributes(), override to add dynamic properties
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$dynamicProperties | array<string|int, mixed> | [] |
Additional dynamic properties exposed on the object |
Return values
array<string|int, mixed>