class EntityTypeManagerTestEntity

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTestEntity
  2. 10 core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTestEntity
  3. 11.x core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTestEntity

Provides a content entity with dummy static method implementations.

Hierarchy

Expanded class hierarchy of EntityTypeManagerTestEntity

File

core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php, line 793

Namespace

Drupal\Tests\Core\Entity
View source
abstract class EntityTypeManagerTestEntity implements \Iterator, ContentEntityInterface {
    
    /**
     * The base field definitions.
     *
     * @var \Drupal\Core\Field\FieldDefinitionInterface[]
     */
    public static $baseFieldDefinitions = [];
    
    /**
     * The bundle field definitions.
     *
     * @var array[]
     *   Keys are entity type IDs, values are arrays of which the keys are bundle
     *   names and the values are field definitions.
     */
    public static $bundleFieldDefinitions = [];
    
    /**
     * {@inheritdoc}
     */
    public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
        return static::$baseFieldDefinitions;
    }
    
    /**
     * {@inheritdoc}
     */
    public static function bundleFieldDefinitions(EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {
        return isset(static::$bundleFieldDefinitions[$entity_type->id()][$bundle]) ? static::$bundleFieldDefinitions[$entity_type->id()][$bundle] : [];
    }

}

Members

Title Sort descending Modifiers Object type Summary
EntityTypeManagerTestEntity::$baseFieldDefinitions public static property The base field definitions.
EntityTypeManagerTestEntity::$bundleFieldDefinitions public static property The bundle field definitions.
EntityTypeManagerTestEntity::baseFieldDefinitions public static function
EntityTypeManagerTestEntity::bundleFieldDefinitions public static function

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