You are here

EntityTestMul.php in Multiversion 8.2

File

src/Entity/EntityTestMul.php
View source
<?php

namespace Drupal\multiversion\Entity;

use Drupal\Core\Entity\EntityPublishedInterface;
use Drupal\Core\Entity\EntityPublishedTrait;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\entity_test\Entity\EntityTestMul as CoreEntityTestMul;
use Drupal\user\StatusItem;
class EntityTestMul extends CoreEntityTestMul implements EntityPublishedInterface {
  use EntityPublishedTrait;

  /**
   * {@inheritdoc}
   */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);

    // Add the published field.
    $fields += static::publishedBaseFieldDefinitions($entity_type);

    // @todo Remove the usage of StatusItem in
    //   https://www.drupal.org/project/drupal/issues/2936864.
    $fields['status']
      ->getItemDefinition()
      ->setClass(StatusItem::class);
    return $fields;
  }

}

Classes

Namesort descending Description
EntityTestMul