Class

eZ\Publish\API\Repository\Values\ValueObject

abstract class ValueObject

The base class for all value objects and structs.

Supports readonly properties by marking them as protected. In this case they will only be writable using constructor, and need to be documented using @property-read <$var> in class doc in addition to inline property doc. Writable properties must be public and must be documented inline.

Methods

__construct(array $properties = array())

Construct object optionally with a set of properties.

__set(string $property, string $value)

Magic set function handling writes to non public properties.

mixed __get(string $property)

Magic get function handling read to non public properties.

bool __isset(string $property)

Magic isset function handling isset() to non public properties.

bool __unset(string $property)

Magic unset function handling unset() to non public properties.

static ValueObject __set_state(array $array)

Returns a new instance of this class with the data specified by $array.

mixed attribute(string $property)

Internal function for Legacy template engine compatibility to get property value.

array attributes()

Internal function for Legacy template engine compatibility to get properties.

bool hasAttribute(string $property)

Internal function for Legacy template engine compatibility to check existence of property.

Details

at line 32
public __construct(array $properties = array())

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

array $properties

at line 75
public __set(string $property, string $value)

Magic set function handling writes to non public properties.

Parameters

string $property Name of the property
string $value

Exceptions

PropertyNotFoundException When property does not exist
PropertyReadOnlyException When property is readonly (protected)

at line 96
public mixed __get(string $property)

Magic get function handling read to non public properties.

Returns value for all readonly (protected) properties.

Parameters

string $property Name of the property

Return Value

mixed

Exceptions

PropertyNotFoundException exception on all reads to undefined properties so typos are not silently accepted.

at line 115
public bool __isset(string $property)

Magic isset function handling isset() to non public properties.

Returns true for all (public/)protected/private properties.

Parameters

string $property Name of the property

Return Value

bool

at line 134
public bool __unset(string $property)

Magic unset function handling unset() to non public properties.

Parameters

string $property Name of the property

Return Value

bool

Exceptions

PropertyNotFoundException exception on all writes to undefined properties so typos are not silently accepted and
PropertyReadOnlyException exception on readonly (protected) properties.

at line 155
static public ValueObject __set_state(array $array)

Returns a new instance of this class with the data specified by $array.

$array contains all the data members of this class in the form: array('member_name'=>value).

__setstate makes this class exportable with varexport. var_export() generates code, that calls this method when it is parsed with PHP.

Parameters

array $array

Return Value

ValueObject

at line 173
final public mixed attribute(string $property)

Internal function for Legacy template engine compatibility to get property value.

Parameters

string $property

Return Value

mixed

at line 189
final public array attributes()

Internal function for Legacy template engine compatibility to get properties.

Return Value

array

at line 207
final public bool hasAttribute(string $property)

Internal function for Legacy template engine compatibility to check existence of property.

Parameters

string $property

Return Value

bool