Class

eZ\Publish\Core\Repository\Values\Content\Content

class Content extends Content

this class represents a content object in a specific version.

Methods

VersionInfo getVersionInfo()

Returns the VersionInfo for this version.

string|null getName(string|null $languageCode = null)

Shorthand method for getVersionInfo()->getName().

from Content
Value|null getFieldValue(string $fieldDefIdentifier, string $languageCode = null)

Returns a field value for the given value.

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.

__construct(array $data = array())

__get($property)

{@inheritdoc}

__isset($property)

{@inheritdoc}

Details

at line 65
public VersionInfo getVersionInfo()

Returns the VersionInfo for this version.

Return Value

VersionInfo

in Content at line 40
public string|null getName(string|null $languageCode = null)

Shorthand method for getVersionInfo()->getName().

Parameters

string|null $languageCode

Return Value

string|null The name for a given language, or null if $languageCode is not set or does not exist.

See also

\eZ\Publish\API\Repository\Values\Content\VersionInfo::getName()

at line 73
public Value|null getFieldValue(string $fieldDefIdentifier, string $languageCode = null)

Returns a field value for the given value.

On non translatable fields this method ignores the languageCode parameter, and return main language field value.

Parameters

string $fieldDefIdentifier
string $languageCode

Return Value

Value|null a primitive type or a field type Value object depending on the field type.

at line 89
public Field[] getFields()

This method returns the complete fields collection.

Return Value

Field[] An array of {@link Field}

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

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

Parameters

string $languageCode

Return Value

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

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

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

On non translatable fields this method ignores the languageCode parameter, and return main language field.

Parameters

string $fieldDefIdentifier
string|null $languageCode

Return Value

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

at line 52
public __construct(array $data = array())

Parameters

array $data

at line 145
public __get($property)

{@inheritdoc}

Parameters

$property

at line 161
public __isset($property)

{@inheritdoc}

Parameters

$property