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

See also: eZ\Publish\API\Repository\Values\Content\Content
Inheritance: extends eZ\Publish\Core\Repository\Values\Content\Content
Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$contentService eZ\Publish\Core\REST\Client\ContentService
$fields Array of array of field values like[$fieldDefIdentifier][$languageCode]
$versionInfo eZ\Publish\API\Repository\Values\Content\VersionInfo

Public Methods

Method Description
__construct ( eZ\Publish\API\Repository\ContentService $contentService, array $data = [] ) Creates a new struct from the given $data array.
getField ( string $fieldDefIdentifier, string | null $languageCode = null ) : eZ\Publish\API\Repository\Values\Content\Field | null This method returns the field for a given field definition identifier and language.
getFieldValue ( string $fieldDefIdentifier, string $languageCode = null ) : mixed 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.
getFields ( ) : eZ\Publish\API\Repository\Values\Content\Field[] This method returns the complete fields collection.
getFieldsByLanguage ( string $languageCode = null ) : eZ\Publish\API\Repository\Values\Content\Field[] This method returns the fields for a given language and non translatable fields.
getVersionInfo ( ) : eZ\Publish\API\Repository\Values\Content\VersionInfo Returns the VersionInfo for this version.

Method Details

__construct() public method

Creates a new struct from the given $data array.
public __construct ( eZ\Publish\API\Repository\ContentService $contentService, array $data = [] )
$contentService eZ\Publish\API\Repository\ContentService
$data array

getField() public method

If not set the initialLanguage of the content version is used.
public getField ( string $fieldDefIdentifier, string | null $languageCode = null ) : eZ\Publish\API\Repository\Values\Content\Field | null
$fieldDefIdentifier string
$languageCode string | null
return eZ\Publish\API\Repository\Values\Content\Field | null A {@link Field} or null if nothing is found

getFieldValue() public method

On non translatable fields this method ignores the languageCode parameter.
public getFieldValue ( string $fieldDefIdentifier, string $languageCode = null ) : mixed
$fieldDefIdentifier string
$languageCode string
return mixed a primitive type or a field type Value object depending on the field type.

getFields() public method

This method returns the complete fields collection.
public getFields ( ) : eZ\Publish\API\Repository\Values\Content\Field[]
return eZ\Publish\API\Repository\Values\Content\Field[] An array of {@link Field}

getFieldsByLanguage() public method

If not set the initialLanguage of the content version is used.
public getFieldsByLanguage ( string $languageCode = null ) : eZ\Publish\API\Repository\Values\Content\Field[]
$languageCode string
return eZ\Publish\API\Repository\Values\Content\Field[] An array of {@link Field} with field identifier as keys

getVersionInfo() public method

Returns the VersionInfo for this version.
public getVersionInfo ( ) : eZ\Publish\API\Repository\Values\Content\VersionInfo
return eZ\Publish\API\Repository\Values\Content\VersionInfo

Property Details

$contentService protected property

protected ContentService,eZ\Publish\Core\REST\Client $contentService
return eZ\Publish\Core\REST\Client\ContentService

$fields protected property

Array of array of field values like[$fieldDefIdentifier][$languageCode]
protected $fields

$versionInfo protected property

protected VersionInfo,eZ\Publish\API\Repository\Values\Content $versionInfo
return eZ\Publish\API\Repository\Values\Content\VersionInfo