Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\Core\Entity;
|
Chris@0
|
4
|
Chris@0
|
5 /**
|
Chris@0
|
6 * Defines a common interface for all content entity objects.
|
Chris@0
|
7 *
|
Chris@16
|
8 * Content entities use fields for all their entity properties and can be
|
Chris@16
|
9 * translatable and revisionable. Translations and revisions can be
|
Chris@16
|
10 * enabled per entity type through annotation and using entity type hooks.
|
Chris@16
|
11 *
|
Chris@16
|
12 * It's best practice to always implement ContentEntityInterface for
|
Chris@16
|
13 * content-like entities that should be stored in some database, and
|
Chris@16
|
14 * 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@16
|
20 * @see \Drupal\Core\Entity\EntityTypeInterface
|
Chris@0
|
21 *
|
Chris@0
|
22 * @ingroup entity_api
|
Chris@0
|
23 */
|
Chris@14
|
24 interface ContentEntityInterface extends \Traversable, FieldableEntityInterface, TranslatableRevisionableInterface {
|
Chris@0
|
25
|
Chris@0
|
26 /**
|
Chris@0
|
27 * Gets the loaded Revision ID of the entity.
|
Chris@0
|
28 *
|
Chris@0
|
29 * @return int
|
Chris@0
|
30 * The loaded Revision identifier of the entity, or NULL if the entity
|
Chris@0
|
31 * does not have a revision identifier.
|
Chris@0
|
32 */
|
Chris@0
|
33 public function getLoadedRevisionId();
|
Chris@0
|
34
|
Chris@0
|
35 /**
|
Chris@0
|
36 * Updates the loaded Revision ID with the revision ID.
|
Chris@0
|
37 *
|
Chris@0
|
38 * This method should not be used, it could unintentionally cause the original
|
Chris@0
|
39 * revision ID property value to be lost.
|
Chris@0
|
40 *
|
Chris@0
|
41 * @internal
|
Chris@0
|
42 *
|
Chris@0
|
43 * @return $this
|
Chris@0
|
44 */
|
Chris@0
|
45 public function updateLoadedRevisionId();
|
Chris@0
|
46
|
Chris@0
|
47 }
|