class EntityTypeManagerTestEntityBundle

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

Provides a bundle specific class with dummy static method implementations.

Hierarchy

Expanded class hierarchy of EntityTypeManagerTestEntityBundle

File

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

Namespace

Drupal\Tests\Core\Entity
View source
abstract class EntityTypeManagerTestEntityBundle extends EntityTypeManagerTestEntity {
  
  /**
   * The bundle class 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 $bundleClassFieldDefinitions = [];
  
  /**
   * {@inheritdoc}
   */
  public static function bundleFieldDefinitions(EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {
    $definitions = parent::bundleFieldDefinitions($entity_type, $bundle, $base_field_definitions);
    if (isset(static::$bundleClassFieldDefinitions[$entity_type->id()][$bundle])) {
      $definitions += static::$bundleClassFieldDefinitions[$entity_type->id()][$bundle];
    }
    return $definitions;
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
EntityTypeManagerTestEntity::$baseFieldDefinitions public static property The base field definitions.
EntityTypeManagerTestEntity::$bundleFieldDefinitions public static property The bundle field definitions. 1
EntityTypeManagerTestEntity::baseFieldDefinitions public static function
EntityTypeManagerTestEntityBundle::$bundleClassFieldDefinitions public static property The bundle class field definitions.
EntityTypeManagerTestEntityBundle::bundleFieldDefinitions public static function Overrides EntityTypeManagerTestEntity::bundleFieldDefinitions

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