Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\content_translation;
|
Chris@0
|
4
|
Chris@0
|
5 use Drupal\user\UserInterface;
|
Chris@0
|
6
|
Chris@0
|
7 /**
|
Chris@0
|
8 * Common interface for content translation metadata wrappers.
|
Chris@0
|
9 *
|
Chris@0
|
10 * This acts as a wrapper for an entity translation object, encapsulating the
|
Chris@0
|
11 * logic needed to retrieve translation metadata.
|
Chris@0
|
12 */
|
Chris@0
|
13 interface ContentTranslationMetadataWrapperInterface {
|
Chris@0
|
14
|
Chris@0
|
15 /**
|
Chris@0
|
16 * Retrieves the source language for this translation.
|
Chris@0
|
17 *
|
Chris@0
|
18 * @return string
|
Chris@0
|
19 * The source language code.
|
Chris@0
|
20 */
|
Chris@0
|
21 public function getSource();
|
Chris@0
|
22
|
Chris@0
|
23 /**
|
Chris@0
|
24 * Sets the source language for this translation.
|
Chris@0
|
25 *
|
Chris@0
|
26 * @param string $source
|
Chris@0
|
27 * The source language code.
|
Chris@0
|
28 *
|
Chris@0
|
29 * @return $this
|
Chris@0
|
30 */
|
Chris@0
|
31 public function setSource($source);
|
Chris@0
|
32
|
Chris@0
|
33 /**
|
Chris@0
|
34 * Returns the translation outdated status.
|
Chris@0
|
35 *
|
Chris@0
|
36 * @return bool
|
Chris@0
|
37 * TRUE if the translation is outdated, FALSE otherwise.
|
Chris@0
|
38 */
|
Chris@0
|
39 public function isOutdated();
|
Chris@0
|
40
|
Chris@0
|
41 /**
|
Chris@0
|
42 * Sets the translation outdated status.
|
Chris@0
|
43 *
|
Chris@0
|
44 * @param bool $outdated
|
Chris@0
|
45 * TRUE if the translation is outdated, FALSE otherwise.
|
Chris@0
|
46 *
|
Chris@0
|
47 * @return $this
|
Chris@0
|
48 */
|
Chris@0
|
49 public function setOutdated($outdated);
|
Chris@0
|
50
|
Chris@0
|
51 /**
|
Chris@0
|
52 * Returns the translation author.
|
Chris@0
|
53 *
|
Chris@0
|
54 * @return \Drupal\user\UserInterface
|
Chris@0
|
55 * The user entity for the translation author.
|
Chris@0
|
56 */
|
Chris@0
|
57 public function getAuthor();
|
Chris@0
|
58
|
Chris@0
|
59 /**
|
Chris@0
|
60 * Sets the translation author.
|
Chris@0
|
61 *
|
Chris@0
|
62 * The metadata field will be updated, only if it's translatable.
|
Chris@0
|
63 *
|
Chris@0
|
64 * @param \Drupal\user\UserInterface $account
|
Chris@0
|
65 * The translation author user entity.
|
Chris@0
|
66 *
|
Chris@0
|
67 * @return $this
|
Chris@0
|
68 */
|
Chris@0
|
69 public function setAuthor(UserInterface $account);
|
Chris@0
|
70
|
Chris@0
|
71 /**
|
Chris@0
|
72 * Returns the translation published status.
|
Chris@0
|
73 *
|
Chris@0
|
74 * @return bool
|
Chris@0
|
75 * TRUE if the translation is published, FALSE otherwise.
|
Chris@0
|
76 */
|
Chris@0
|
77 public function isPublished();
|
Chris@0
|
78
|
Chris@0
|
79 /**
|
Chris@0
|
80 * Sets the translation published status.
|
Chris@0
|
81 *
|
Chris@0
|
82 * The metadata field will be updated, only if it's translatable.
|
Chris@0
|
83 *
|
Chris@0
|
84 * @param bool $published
|
Chris@0
|
85 * TRUE if the translation is published, FALSE otherwise.
|
Chris@0
|
86 *
|
Chris@0
|
87 * @return $this
|
Chris@0
|
88 */
|
Chris@0
|
89 public function setPublished($published);
|
Chris@0
|
90
|
Chris@0
|
91 /**
|
Chris@0
|
92 * Returns the translation creation timestamp.
|
Chris@0
|
93 *
|
Chris@0
|
94 * @return int
|
Chris@0
|
95 * The UNIX timestamp of when the translation was created.
|
Chris@0
|
96 */
|
Chris@0
|
97 public function getCreatedTime();
|
Chris@0
|
98
|
Chris@0
|
99 /**
|
Chris@0
|
100 * Sets the translation creation timestamp.
|
Chris@0
|
101 *
|
Chris@0
|
102 * The metadata field will be updated, only if it's translatable.
|
Chris@0
|
103 *
|
Chris@0
|
104 * @param int $timestamp
|
Chris@0
|
105 * The UNIX timestamp of when the translation was created.
|
Chris@0
|
106 *
|
Chris@0
|
107 * @return $this
|
Chris@0
|
108 */
|
Chris@0
|
109 public function setCreatedTime($timestamp);
|
Chris@0
|
110
|
Chris@0
|
111 /**
|
Chris@0
|
112 * Returns the timestamp of the last entity change from current translation.
|
Chris@0
|
113 *
|
Chris@0
|
114 * @return int
|
Chris@0
|
115 * The timestamp of the last entity save operation.
|
Chris@0
|
116 */
|
Chris@0
|
117 public function getChangedTime();
|
Chris@0
|
118
|
Chris@0
|
119 /**
|
Chris@0
|
120 * Sets the translation modification timestamp.
|
Chris@0
|
121 *
|
Chris@0
|
122 * The metadata field will be updated, only if it's translatable.
|
Chris@0
|
123 *
|
Chris@0
|
124 * @param int $timestamp
|
Chris@0
|
125 * The UNIX timestamp of when the translation was last modified.
|
Chris@0
|
126 *
|
Chris@0
|
127 * @return $this
|
Chris@0
|
128 */
|
Chris@0
|
129 public function setChangedTime($timestamp);
|
Chris@0
|
130
|
Chris@0
|
131 }
|