interface ContentTranslationMetadataWrapperInterface

Same name in other branches
  1. 9 core/modules/content_translation/src/ContentTranslationMetadataWrapperInterface.php \Drupal\content_translation\ContentTranslationMetadataWrapperInterface
  2. 10 core/modules/content_translation/src/ContentTranslationMetadataWrapperInterface.php \Drupal\content_translation\ContentTranslationMetadataWrapperInterface
  3. 11.x core/modules/content_translation/src/ContentTranslationMetadataWrapperInterface.php \Drupal\content_translation\ContentTranslationMetadataWrapperInterface

Common interface for content translation metadata wrappers.

This acts as a wrapper for an entity translation object, encapsulating the logic needed to retrieve translation metadata.

Hierarchy

Expanded class hierarchy of ContentTranslationMetadataWrapperInterface

All classes that implement ContentTranslationMetadataWrapperInterface

File

core/modules/content_translation/src/ContentTranslationMetadataWrapperInterface.php, line 13

Namespace

Drupal\content_translation
View source
interface ContentTranslationMetadataWrapperInterface {
    
    /**
     * Retrieves the source language for this translation.
     *
     * @return string
     *   The source language code.
     */
    public function getSource();
    
    /**
     * Sets the source language for this translation.
     *
     * @param string $source
     *   The source language code.
     *
     * @return $this
     */
    public function setSource($source);
    
    /**
     * Returns the translation outdated status.
     *
     * @return bool
     *   TRUE if the translation is outdated, FALSE otherwise.
     */
    public function isOutdated();
    
    /**
     * Sets the translation outdated status.
     *
     * @param bool $outdated
     *   TRUE if the translation is outdated, FALSE otherwise.
     *
     * @return $this
     */
    public function setOutdated($outdated);
    
    /**
     * Returns the translation author.
     *
     * @return \Drupal\user\UserInterface
     *   The user entity for the translation author.
     */
    public function getAuthor();
    
    /**
     * Sets the translation author.
     *
     * The metadata field will be updated, only if it's translatable.
     *
     * @param \Drupal\user\UserInterface $account
     *   The translation author user entity.
     *
     * @return $this
     */
    public function setAuthor(UserInterface $account);
    
    /**
     * Returns the translation published status.
     *
     * @return bool
     *   TRUE if the translation is published, FALSE otherwise.
     */
    public function isPublished();
    
    /**
     * Sets the translation published status.
     *
     * The metadata field will be updated, only if it's translatable.
     *
     * @param bool $published
     *   TRUE if the translation is published, FALSE otherwise.
     *
     * @return $this
     */
    public function setPublished($published);
    
    /**
     * Returns the translation creation timestamp.
     *
     * @return int
     *   The UNIX timestamp of when the translation was created.
     */
    public function getCreatedTime();
    
    /**
     * Sets the translation creation timestamp.
     *
     * The metadata field will be updated, only if it's translatable.
     *
     * @param int $timestamp
     *   The UNIX timestamp of when the translation was created.
     *
     * @return $this
     */
    public function setCreatedTime($timestamp);
    
    /**
     * Returns the timestamp of the last entity change from current translation.
     *
     * @return int
     *   The timestamp of the last entity save operation.
     */
    public function getChangedTime();
    
    /**
     * Sets the translation modification timestamp.
     *
     * The metadata field will be updated, only if it's translatable.
     *
     * @param int $timestamp
     *   The UNIX timestamp of when the translation was last modified.
     *
     * @return $this
     */
    public function setChangedTime($timestamp);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
ContentTranslationMetadataWrapperInterface::getAuthor public function Returns the translation author. 1
ContentTranslationMetadataWrapperInterface::getChangedTime public function Returns the timestamp of the last entity change from current translation. 1
ContentTranslationMetadataWrapperInterface::getCreatedTime public function Returns the translation creation timestamp. 1
ContentTranslationMetadataWrapperInterface::getSource public function Retrieves the source language for this translation. 1
ContentTranslationMetadataWrapperInterface::isOutdated public function Returns the translation outdated status. 1
ContentTranslationMetadataWrapperInterface::isPublished public function Returns the translation published status. 1
ContentTranslationMetadataWrapperInterface::setAuthor public function Sets the translation author. 1
ContentTranslationMetadataWrapperInterface::setChangedTime public function Sets the translation modification timestamp. 1
ContentTranslationMetadataWrapperInterface::setCreatedTime public function Sets the translation creation timestamp. 1
ContentTranslationMetadataWrapperInterface::setOutdated public function Sets the translation outdated status. 1
ContentTranslationMetadataWrapperInterface::setPublished public function Sets the translation published status. 1
ContentTranslationMetadataWrapperInterface::setSource public function Sets the source language for this translation. 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.