this class represents a content object in a specific version.
Properties¶
$contentInfo¶
|
|
@deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use Content::getContentInfo() instead.
$fields¶
|
|
access fields, calls getFields()
$id¶
|
|
@deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use Content::getId() instead.
$thumbnail¶
|
|
calls getThumbnail()
$versionInfo¶
|
|
calls getVersionInfo()
Methods¶
__construct() ¶
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
Name | Type | Default value | Description |
---|---|---|---|
$properties | array<string|int, mixed> | [] | - |
getContentInfo() ¶
|
|
Return values
getContentType() ¶
Returns the ContentType for this content.
|
|
Return values
getDefaultLanguageCode() ¶
|
|
Return values
string
getField() ¶
This method returns the field for a given field definition identifier and language.
|
|
- If $languageCode is defined, return if available, otherwise null
- If not pick using the following languages codes when applicable:
- Prioritized languages (if provided to api on object retrieval)
- Main language
On non translatable fields this method ignores the languageCode parameter, and return main language field.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$fieldDefIdentifier | string | - | - |
$languageCode | string|null | null | - |
Return values
Field|null
A Field or null if nothing is found
getFields() ¶
This method returns the complete fields collection.
|
|
Return values
array<string|int, Field>
An array of Field
getFieldsByLanguage() ¶
This method returns the fields for a given language and non translatable fields.
|
|
- If $languageCode is defined, return if available
- If not pick using prioritized languages (if provided to api on object retrieval)
- Otherwise return in main language
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageCode | string|null | null | - |
Return values
array<string|int, Field>
An array of Field with field identifier as keys
getFieldValue() ¶
Returns a field value for the given value.
|
|
- If $languageCode is defined, return if available, otherwise null
- If not pick using the following languages codes when applicable:
- Prioritized languages (if provided to api on object retrieval)
- Main language
On non translatable fields this method ignores the languageCode parameter, and return main language field value.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$fieldDefIdentifier | string | - | - |
$languageCode | string|null | null | - |
Return values
Value|null
a primitive type or a field type Value object depending on the field type.
getId() ¶
|
|
Return values
int
getName() ¶
Shorthand method for getVersionInfo()->getName().
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$languageCode | string|null | null | - |
Return values
string|null
The name for a given language, or null if $languageCode is not set or does not exist.
getThumbnail() ¶
|
|
Return values
Thumbnail|null
getVersionInfo() ¶
Returns the VersionInfo for this version.
|
|
Return values
getProperties() ¶
Function where list of properties are returned.
|
|
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>