EditorialContentEntityBase.php 801 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Drupal\Core\Entity;
  3. /**
  4. * Provides a base entity class with extended revision and publishing support.
  5. *
  6. * @ingroup entity_api
  7. */
  8. abstract class EditorialContentEntityBase extends ContentEntityBase implements EntityChangedInterface, EntityPublishedInterface, RevisionLogInterface {
  9. use EntityChangedTrait;
  10. use EntityPublishedTrait;
  11. use RevisionLogEntityTrait;
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
  16. $fields = parent::baseFieldDefinitions($entity_type);
  17. // Add the revision metadata fields.
  18. $fields += static::revisionLogBaseFieldDefinitions($entity_type);
  19. // Add the published field.
  20. $fields += static::publishedBaseFieldDefinitions($entity_type);
  21. return $fields;
  22. }
  23. }