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