ContentTranslationMetadataWrapper
class ContentTranslationMetadataWrapper implements ContentTranslationMetadataWrapperInterface (View source)
Base class for content translation metadata wrappers.
Properties
| protected FieldableEntityInterface|TranslatableInterface | $translation | The wrapped entity translation. |
|
| protected ContentTranslationHandlerInterface | $handler | The content translation handler. |
Methods
Initializes an instance of the content translation metadata handler.
Retrieves the source language for this translation.
Sets the source language for this translation.
Returns the translation outdated status.
Sets the translation outdated status.
Returns the translation author.
Returns the translation published status.
Sets the translation published status.
Returns the translation creation timestamp.
Sets the translation creation timestamp.
Returns the timestamp of the last entity change from current translation.
Sets the translation modification timestamp.
Updates a field value, only if the field is translatable.
Details
__construct(EntityInterface $translation, ContentTranslationHandlerInterface $handler)
Initializes an instance of the content translation metadata handler.
string
getSource()
Retrieves the source language for this translation.
$this
setSource(string $source)
Sets the source language for this translation.
bool
isOutdated()
Returns the translation outdated status.
$this
setOutdated(bool $outdated)
Sets the translation outdated status.
UserInterface
getAuthor()
Returns the translation author.
$this
setAuthor(UserInterface $account)
Sets the translation author.
The metadata field will be updated, only if it's translatable.
bool
isPublished()
Returns the translation published status.
$this
setPublished(bool $published)
Sets the translation published status.
The metadata field will be updated, only if it's translatable.
int
getCreatedTime()
Returns the translation creation timestamp.
$this
setCreatedTime(int $timestamp)
Sets the translation creation timestamp.
The metadata field will be updated, only if it's translatable.
int
getChangedTime()
Returns the timestamp of the last entity change from current translation.
$this
setChangedTime(int $timestamp)
Sets the translation modification timestamp.
The metadata field will be updated, only if it's translatable.
protected
setFieldOnlyIfTranslatable(string $field_name, mixed $value)
Updates a field value, only if the field is translatable.