EditorialContentEntityBase.php

Same filename and directory in other branches
  1. 9 core/lib/Drupal/Core/Entity/EditorialContentEntityBase.php
  2. 8.9.x core/lib/Drupal/Core/Entity/EditorialContentEntityBase.php
  3. 10 core/lib/Drupal/Core/Entity/EditorialContentEntityBase.php

Namespace

Drupal\Core\Entity

File

core/lib/Drupal/Core/Entity/EditorialContentEntityBase.php

View source
<?php

namespace Drupal\Core\Entity;


/**
 * Provides a base entity class with extended revision and publishing support.
 *
 * @ingroup entity_api
 */
abstract class EditorialContentEntityBase extends ContentEntityBase implements EntityChangedInterface, EntityPublishedInterface, RevisionLogInterface {
    use EntityChangedTrait;
    use EntityPublishedTrait;
    use RevisionLogEntityTrait;
    
    /**
     * {@inheritdoc}
     */
    public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
        $fields = parent::baseFieldDefinitions($entity_type);
        // Add the revision metadata fields.
        $fields += static::revisionLogBaseFieldDefinitions($entity_type);
        // Add the published field.
        $fields += static::publishedBaseFieldDefinitions($entity_type);
        return $fields;
    }

}

Classes

Title Deprecated Summary
EditorialContentEntityBase Provides a base entity class with extended revision and publishing support.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.