Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\Core\Entity;
|
Chris@0
|
4
|
Chris@0
|
5 use Drupal\Core\TypedData\TranslatableInterface;
|
Chris@0
|
6
|
Chris@0
|
7 /**
|
Chris@0
|
8 * Defines a common interface for all content entity objects.
|
Chris@0
|
9 *
|
Chris@0
|
10 * Content entities use fields for all their entity properties and are
|
Chris@0
|
11 * translatable and revisionable, while translations and revisions can be
|
Chris@0
|
12 * enabled per entity type. It's best practice to always implement
|
Chris@0
|
13 * ContentEntityInterface for content-like entities that should be stored in
|
Chris@0
|
14 * some database, and enable/disable revisions and translations as desired.
|
Chris@0
|
15 *
|
Chris@0
|
16 * When implementing this interface which extends Traversable, make sure to list
|
Chris@0
|
17 * IteratorAggregate or Iterator before this interface in the implements clause.
|
Chris@0
|
18 *
|
Chris@0
|
19 * @see \Drupal\Core\Entity\ContentEntityBase
|
Chris@0
|
20 *
|
Chris@0
|
21 * @ingroup entity_api
|
Chris@0
|
22 */
|
Chris@0
|
23 interface ContentEntityInterface extends \Traversable, FieldableEntityInterface, RevisionableInterface, TranslatableInterface {
|
Chris@0
|
24
|
Chris@0
|
25 /**
|
Chris@0
|
26 * Determines if the current translation of the entity has unsaved changes.
|
Chris@0
|
27 *
|
Chris@0
|
28 * @return bool
|
Chris@0
|
29 * TRUE if the current translation of the entity has changes.
|
Chris@0
|
30 */
|
Chris@0
|
31 public function hasTranslationChanges();
|
Chris@0
|
32
|
Chris@0
|
33 /**
|
Chris@0
|
34 * Marks the current revision translation as affected.
|
Chris@0
|
35 *
|
Chris@0
|
36 * @param bool|null $affected
|
Chris@0
|
37 * The flag value. A NULL value can be specified to reset the current value
|
Chris@0
|
38 * and make sure a new value will be computed by the system.
|
Chris@0
|
39 *
|
Chris@0
|
40 * @return $this
|
Chris@0
|
41 */
|
Chris@0
|
42 public function setRevisionTranslationAffected($affected);
|
Chris@0
|
43
|
Chris@0
|
44 /**
|
Chris@0
|
45 * Checks whether the current translation is affected by the current revision.
|
Chris@0
|
46 *
|
Chris@0
|
47 * @return bool
|
Chris@0
|
48 * TRUE if the entity object is affected by the current revision, FALSE
|
Chris@0
|
49 * otherwise.
|
Chris@0
|
50 */
|
Chris@0
|
51 public function isRevisionTranslationAffected();
|
Chris@0
|
52
|
Chris@0
|
53 /**
|
Chris@0
|
54 * Gets the loaded Revision ID of the entity.
|
Chris@0
|
55 *
|
Chris@0
|
56 * @return int
|
Chris@0
|
57 * The loaded Revision identifier of the entity, or NULL if the entity
|
Chris@0
|
58 * does not have a revision identifier.
|
Chris@0
|
59 */
|
Chris@0
|
60 public function getLoadedRevisionId();
|
Chris@0
|
61
|
Chris@0
|
62 /**
|
Chris@0
|
63 * Updates the loaded Revision ID with the revision ID.
|
Chris@0
|
64 *
|
Chris@0
|
65 * This method should not be used, it could unintentionally cause the original
|
Chris@0
|
66 * revision ID property value to be lost.
|
Chris@0
|
67 *
|
Chris@0
|
68 * @internal
|
Chris@0
|
69 *
|
Chris@0
|
70 * @return $this
|
Chris@0
|
71 */
|
Chris@0
|
72 public function updateLoadedRevisionId();
|
Chris@0
|
73
|
Chris@0
|
74 }
|