Class

eZ\Publish\Core\REST\Client\Values\Content\Content

class Content extends Content

Implementation of the {@link \eZ\Publish\API\Repository\Values\Content\Content} class.

Methods

__construct(ContentService $contentService, array $data = array())

Creates a new struct from the given $data array.

VersionInfo getVersionInfo()

Returns the VersionInfo for this version.

mixed getFieldValue(string $fieldDefIdentifier, string $languageCode = null)

Returns a field value for the given value $version->fields[$fieldDefId][$languageCode] is an equivalent call if no language is given on a translatable field this method returns the value of the initial language of the version if present, otherwise null.

Field[] getFields()

This method returns the complete fields collection.

Field[] getFieldsByLanguage(string $languageCode = null)

This method returns the fields for a given language and non translatable fields.

Field|null getField(string $fieldDefIdentifier, string|null $languageCode = null)

This method returns the field for a given field definition identifier and language.

__get($property)

{@inheritdoc}

from Content
__isset($property)

{@inheritdoc}

from Content

Details

at line 56
public __construct(ContentService $contentService, array $data = array())

Creates a new struct from the given $data array.

Parameters

ContentService $contentService
array $data

at line 72
public VersionInfo getVersionInfo()

Returns the VersionInfo for this version.

Return Value

VersionInfo

at line 89
public mixed getFieldValue(string $fieldDefIdentifier, string $languageCode = null)

Returns a field value for the given value $version->fields[$fieldDefId][$languageCode] is an equivalent call if no language is given on a translatable field this method returns the value of the initial language of the version if present, otherwise null.

On non translatable fields this method ignores the languageCode parameter.

Parameters

string $fieldDefIdentifier
string $languageCode

Return Value

mixed a primitive type or a field type Value object depending on the field type.

at line 107
public Field[] getFields()

This method returns the complete fields collection.

Return Value

Field[] An array of {@link Field}

at line 121
public Field[] getFieldsByLanguage(string $languageCode = null)

This method returns the fields for a given language and non translatable fields.

If not set the initialLanguage of the content version is used.

Parameters

string $languageCode

Return Value

Field[] An array of {@link Field} with field identifier as keys

at line 148
public Field|null getField(string $fieldDefIdentifier, string|null $languageCode = null)

This method returns the field for a given field definition identifier and language.

If not set the initialLanguage of the content version is used.

Parameters

string $fieldDefIdentifier
string|null $languageCode

Return Value

Field|null A {@link Field} or null if nothing is found

in Content at line 145
public __get($property)

{@inheritdoc}

Parameters

$property

in Content at line 161
public __isset($property)

{@inheritdoc}

Parameters

$property