ContentEntityTypeInterface.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace Drupal\Core\Entity;
  3. /**
  4. * Provides an interface for a content entity type and its metadata.
  5. */
  6. interface ContentEntityTypeInterface extends EntityTypeInterface {
  7. /**
  8. * Gets an array of entity revision metadata keys.
  9. *
  10. * @param bool $include_backwards_compatibility_field_names
  11. * (optional and deprecated) Whether to provide the revision keys on a
  12. * best-effort basis by looking at the base fields defined by the entity
  13. * type. Note that this parameter will be removed in Drupal 9.0.0. Defaults
  14. * to TRUE.
  15. *
  16. * @return array
  17. * An array describing how the Field API can extract revision metadata
  18. * information of this entity type:
  19. * - revision_log_message: The name of the property that contains description
  20. * of the changes that were made in the current revision.
  21. * - revision_user: The name of the property that contains the user ID of
  22. * the author of the current revision.
  23. * - revision_created: The name of the property that contains the timestamp
  24. * of the current revision.
  25. */
  26. public function getRevisionMetadataKeys($include_backwards_compatibility_field_names = TRUE);
  27. /**
  28. * Gets a specific entity revision metadata key.
  29. *
  30. * @param string $key
  31. * The name of the entity revision metadata key to return.
  32. *
  33. * @return string|bool
  34. * The entity revision metadata key, or FALSE if it does not exist.
  35. *
  36. * @see self::getRevisionMetadataKeys()
  37. */
  38. public function getRevisionMetadataKey($key);
  39. /**
  40. * Indicates if a given entity revision metadata key exists.
  41. *
  42. * @param string $key
  43. * The name of the entity revision metadata key to check.
  44. *
  45. * @return bool
  46. * TRUE if a given entity revision metadata key exists, FALSE otherwise.
  47. */
  48. public function hasRevisionMetadataKey($key);
  49. }