Copied!

ContentStruct

ContentStruct.php : 18
Extends ValueObject

Base struct for content create/update structs.

Properties

public $fields

ContentStruct.php
public array<string|int, Field$fields

Methods

public__construct()

ValueObject.php : 30

Construct object optionally with a set of properties.

public __construct([array<string|int, mixed> $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> [] -

publicsetField()

ContentStruct.php : 32

Adds a field to the field collection.

public abstract setField(string $fieldDefIdentifier, mixed $value[, string|null $language = null ]) : void

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

protectedgetProperties()

ValueObject.php : 50

Function where list of properties are returned.

protected getProperties([array<string|int, mixed> $dynamicProperties = [] ]) : array<string|int, mixed>

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>