Drupal 8  8.0.2
ContentTranslationMetadataWrapper Class Reference
Inheritance diagram for ContentTranslationMetadataWrapper:

Public Member Functions

 __construct (EntityInterface $translation, ContentTranslationHandlerInterface $handler)
 
 getSource ()
 
 setSource ($source)
 
 isOutdated ()
 
 setOutdated ($outdated)
 
 getAuthor ()
 
 setAuthor (UserInterface $account)
 
 isPublished ()
 
 setPublished ($published)
 
 getCreatedTime ()
 
 setCreatedTime ($timestamp)
 
 getChangedTime ()
 
 setChangedTime ($timestamp)
 

Protected Member Functions

 setFieldOnlyIfTranslatable ($field_name, $value)
 

Protected Attributes

 $translation
 
 $handler
 

Detailed Description

Base class for content translation metadata wrappers.

Constructor & Destructor Documentation

__construct ( EntityInterface  $translation,
ContentTranslationHandlerInterface  $handler 
)

Initializes an instance of the content translation metadata handler.

Parameters
EntityInterface$translationThe entity translation to be wrapped.
ContentTranslationHandlerInterface$handlerThe content translation handler.

References Drupal\translation().

Here is the call graph for this function:

Member Function Documentation

getAuthor ( )

{Returns the translation author.

Returns
The user entity for the translation author.
}

Implements ContentTranslationMetadataWrapperInterface.

References Drupal\translation().

Here is the call graph for this function:

getChangedTime ( )

{Returns the timestamp of the last entity change from current translation.

Returns
int The timestamp of the last entity save operation.
}

Implements ContentTranslationMetadataWrapperInterface.

References Drupal\translation().

Here is the call graph for this function:

getCreatedTime ( )

{Returns the translation creation timestamp.

Returns
int The UNIX timestamp of when the translation was created.
}

Implements ContentTranslationMetadataWrapperInterface.

References Drupal\translation().

Here is the call graph for this function:

getSource ( )

{Retrieves the source language for this translation.

Returns
string The source language code.
}

Implements ContentTranslationMetadataWrapperInterface.

References Drupal\translation().

Here is the call graph for this function:

isOutdated ( )

{Returns the translation outdated status.

Returns
bool TRUE if the translation is outdated, FALSE otherwise.
}

Implements ContentTranslationMetadataWrapperInterface.

References Drupal\translation().

Here is the call graph for this function:

isPublished ( )

{Returns the translation published status.

Returns
bool TRUE if the translation is published, FALSE otherwise.
}

Implements ContentTranslationMetadataWrapperInterface.

References Drupal\translation().

Here is the call graph for this function:

setAuthor ( UserInterface  $account)

{Sets the translation author.The metadata field will be updated, only if it's translatable.

Parameters
\Drupal\user\UserInterface$accountThe translation author user entity.
Returns
$this
}

Implements ContentTranslationMetadataWrapperInterface.

References AccountInterface\id(), ContentTranslationMetadataWrapper\setFieldOnlyIfTranslatable(), and Drupal\translation().

Here is the call graph for this function:

setChangedTime (   $timestamp)

{Sets the translation modification timestamp.The metadata field will be updated, only if it's translatable.

Parameters
int$timestampThe UNIX timestamp of when the translation was last modified.
Returns
$this
}

Implements ContentTranslationMetadataWrapperInterface.

References ContentTranslationMetadataWrapper\setFieldOnlyIfTranslatable(), and Drupal\translation().

Here is the call graph for this function:

setCreatedTime (   $timestamp)

{Sets the translation creation timestamp.The metadata field will be updated, only if it's translatable.

Parameters
int$timestampThe UNIX timestamp of when the translation was created.
Returns
$this
}

Implements ContentTranslationMetadataWrapperInterface.

References ContentTranslationMetadataWrapper\setFieldOnlyIfTranslatable(), and Drupal\translation().

Here is the call graph for this function:

setFieldOnlyIfTranslatable (   $field_name,
  $value 
)
protected

Updates a field value, only if the field is translatable.

Parameters
string$field_nameThe name of the field.
mixed$valueThe field value to be set.

References Drupal\translation().

Referenced by ContentTranslationMetadataWrapper\setAuthor(), ContentTranslationMetadataWrapper\setChangedTime(), ContentTranslationMetadataWrapper\setCreatedTime(), and ContentTranslationMetadataWrapper\setPublished().

Here is the call graph for this function:

Here is the caller graph for this function:

setOutdated (   $outdated)

{Sets the translation outdated status.

Parameters
bool$outdatedTRUE if the translation is outdated, FALSE otherwise.
Returns
$this
}

Implements ContentTranslationMetadataWrapperInterface.

References Drupal\translation().

Here is the call graph for this function:

setPublished (   $published)

{Sets the translation published status.The metadata field will be updated, only if it's translatable.

Parameters
bool$publishedTRUE if the translation is published, FALSE otherwise.
Returns
$this
}

Implements ContentTranslationMetadataWrapperInterface.

References ContentTranslationMetadataWrapper\setFieldOnlyIfTranslatable(), and Drupal\translation().

Here is the call graph for this function:

setSource (   $source)

{Sets the source language for this translation.

Parameters
string$sourceThe source language code.
Returns
$this
}

Implements ContentTranslationMetadataWrapperInterface.

References Drupal\translation().

Here is the call graph for this function:


The documentation for this class was generated from the following file: