Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / lib / Drupal / Core / Entity / ContentEntityInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 /**
6  * Defines a common interface for all content entity objects.
7  *
8  * Content entities use fields for all their entity properties and are
9  * translatable and revisionable, while translations and revisions can be
10  * enabled per entity type. It's best practice to always implement
11  * ContentEntityInterface for content-like entities that should be stored in
12  * some database, and enable/disable revisions and translations as desired.
13  *
14  * When implementing this interface which extends Traversable, make sure to list
15  * IteratorAggregate or Iterator before this interface in the implements clause.
16  *
17  * @see \Drupal\Core\Entity\ContentEntityBase
18  *
19  * @ingroup entity_api
20  */
21 interface ContentEntityInterface extends \Traversable, FieldableEntityInterface, TranslatableRevisionableInterface {
22
23   /**
24    * Gets the loaded Revision ID of the entity.
25    *
26    * @return int
27    *   The loaded Revision identifier of the entity, or NULL if the entity
28    *   does not have a revision identifier.
29    */
30   public function getLoadedRevisionId();
31
32   /**
33    * Updates the loaded Revision ID with the revision ID.
34    *
35    * This method should not be used, it could unintentionally cause the original
36    * revision ID property value to be lost.
37    *
38    * @internal
39    *
40    * @return $this
41    */
42   public function updateLoadedRevisionId();
43
44 }