Chris@14
|
1 <?php
|
Chris@14
|
2
|
Chris@14
|
3 namespace Drupal\Core\Entity;
|
Chris@14
|
4
|
Chris@14
|
5 /**
|
Chris@14
|
6 * Provides methods for an entity to support revision translation.
|
Chris@14
|
7 */
|
Chris@14
|
8 interface TranslatableRevisionableInterface extends TranslatableInterface, RevisionableInterface {
|
Chris@14
|
9
|
Chris@14
|
10 /**
|
Chris@14
|
11 * Checks whether this is the latest revision affecting this translation.
|
Chris@14
|
12 *
|
Chris@14
|
13 * @return bool
|
Chris@14
|
14 * TRUE if this revision is the latest one affecting the active translation,
|
Chris@14
|
15 * FALSE otherwise.
|
Chris@14
|
16 */
|
Chris@14
|
17 public function isLatestTranslationAffectedRevision();
|
Chris@14
|
18
|
Chris@14
|
19 /**
|
Chris@14
|
20 * Marks the current revision translation as affected.
|
Chris@14
|
21 *
|
Chris@14
|
22 * Setting the revision translation affected flag through the setter or
|
Chris@14
|
23 * through the field directly will always enforce it, which will be used by
|
Chris@14
|
24 * the entity storage to determine if the flag should be recomputed or the set
|
Chris@14
|
25 * value should be used instead.
|
Chris@14
|
26 * @see \Drupal\Core\Entity\ContentEntityStorageBase::populateAffectedRevisionTranslations()
|
Chris@14
|
27 *
|
Chris@14
|
28 * @param bool|null $affected
|
Chris@14
|
29 * The flag value. A NULL value can be specified to reset the current value
|
Chris@14
|
30 * and make sure a new value will be computed by the system.
|
Chris@14
|
31 *
|
Chris@14
|
32 * @return $this
|
Chris@14
|
33 */
|
Chris@14
|
34 public function setRevisionTranslationAffected($affected);
|
Chris@14
|
35
|
Chris@14
|
36 /**
|
Chris@14
|
37 * Checks whether the current translation is affected by the current revision.
|
Chris@14
|
38 *
|
Chris@14
|
39 * @return bool
|
Chris@14
|
40 * TRUE if the entity object is affected by the current revision, FALSE
|
Chris@14
|
41 * otherwise.
|
Chris@14
|
42 */
|
Chris@14
|
43 public function isRevisionTranslationAffected();
|
Chris@14
|
44
|
Chris@14
|
45 /**
|
Chris@14
|
46 * Checks if the revision translation affected flag value has been enforced.
|
Chris@14
|
47 *
|
Chris@14
|
48 * @return bool
|
Chris@14
|
49 * TRUE if revision translation affected flag is enforced, FALSE otherwise.
|
Chris@14
|
50 *
|
Chris@14
|
51 * @internal
|
Chris@14
|
52 */
|
Chris@14
|
53 public function isRevisionTranslationAffectedEnforced();
|
Chris@14
|
54
|
Chris@14
|
55 /**
|
Chris@14
|
56 * Enforces the revision translation affected flag value.
|
Chris@14
|
57 *
|
Chris@14
|
58 * Note that this method call will not have any influence on the storage if
|
Chris@14
|
59 * the value of the revision translation affected flag is NULL which is used
|
Chris@14
|
60 * as an indication for the storage to recompute the flag.
|
Chris@14
|
61 * @see \Drupal\Core\Entity\ContentEntityInterface::setRevisionTranslationAffected()
|
Chris@14
|
62 *
|
Chris@14
|
63 * @param bool $enforced
|
Chris@14
|
64 * If TRUE, the value of the revision translation affected flag will be
|
Chris@14
|
65 * enforced so that on entity save the entity storage will not recompute it.
|
Chris@14
|
66 * Otherwise the storage will recompute it.
|
Chris@14
|
67 *
|
Chris@14
|
68 * @return $this
|
Chris@14
|
69 *
|
Chris@14
|
70 * @internal
|
Chris@14
|
71 */
|
Chris@14
|
72 public function setRevisionTranslationAffectedEnforced($enforced);
|
Chris@14
|
73
|
Chris@14
|
74 /**
|
Chris@14
|
75 * Checks if untranslatable fields should affect only the default translation.
|
Chris@14
|
76 *
|
Chris@14
|
77 * @return bool
|
Chris@14
|
78 * TRUE if untranslatable fields should affect only the default translation,
|
Chris@14
|
79 * FALSE otherwise.
|
Chris@14
|
80 */
|
Chris@14
|
81 public function isDefaultTranslationAffectedOnly();
|
Chris@14
|
82
|
Chris@14
|
83 }
|