ContentEntityInterface.php 1.3 KB

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