3 namespace Drupal\content_translation;
5 use Drupal\user\UserInterface;
8 * Common interface for content translation metadata wrappers.
10 * This acts as a wrapper for an entity translation object, encapsulating the
11 * logic needed to retrieve translation metadata.
13 interface ContentTranslationMetadataWrapperInterface {
16 * Retrieves the source language for this translation.
19 * The source language code.
21 public function getSource();
24 * Sets the source language for this translation.
26 * @param string $source
27 * The source language code.
31 public function setSource($source);
34 * Returns the translation outdated status.
37 * TRUE if the translation is outdated, FALSE otherwise.
39 public function isOutdated();
42 * Sets the translation outdated status.
44 * @param bool $outdated
45 * TRUE if the translation is outdated, FALSE otherwise.
49 public function setOutdated($outdated);
52 * Returns the translation author.
54 * @return \Drupal\user\UserInterface
55 * The user entity for the translation author.
57 public function getAuthor();
60 * Sets the translation author.
62 * The metadata field will be updated, only if it's translatable.
64 * @param \Drupal\user\UserInterface $account
65 * The translation author user entity.
69 public function setAuthor(UserInterface $account);
72 * Returns the translation published status.
75 * TRUE if the translation is published, FALSE otherwise.
77 public function isPublished();
80 * Sets the translation published status.
82 * The metadata field will be updated, only if it's translatable.
84 * @param bool $published
85 * TRUE if the translation is published, FALSE otherwise.
89 public function setPublished($published);
92 * Returns the translation creation timestamp.
95 * The UNIX timestamp of when the translation was created.
97 public function getCreatedTime();
100 * Sets the translation creation timestamp.
102 * The metadata field will be updated, only if it's translatable.
104 * @param int $timestamp
105 * The UNIX timestamp of when the translation was created.
109 public function setCreatedTime($timestamp);
112 * Returns the timestamp of the last entity change from current translation.
115 * The timestamp of the last entity save operation.
117 public function getChangedTime();
120 * Sets the translation modification timestamp.
122 * The metadata field will be updated, only if it's translatable.
124 * @param int $timestamp
125 * The UNIX timestamp of when the translation was last modified.
129 public function setChangedTime($timestamp);