function ConfigEntityType::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php \Drupal\Core\Config\Entity\ConfigEntityType::__construct()
  2. 10 core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php \Drupal\Core\Config\Entity\ConfigEntityType::__construct()
  3. 11.x core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php \Drupal\Core\Config\Entity\ConfigEntityType::__construct()
  4. 11.x core/lib/Drupal/Core/Entity/Attribute/ConfigEntityType.php \Drupal\Core\Entity\Attribute\ConfigEntityType::__construct()

Throws

\Drupal\Core\Config\Entity\Exception\ConfigEntityStorageClassException Exception thrown when the provided class is not an instance of \Drupal\Core\Config\Entity\ConfigEntityStorage.

Overrides EntityType::__construct

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php, line 58

Class

ConfigEntityType
Provides an implementation of a configuration entity type and its metadata.

Namespace

Drupal\Core\Config\Entity

Code

public function __construct($definition) {
    // Ensure a default list cache tag is set; do this before calling the parent
    // constructor, because we want "Configuration System style" cache tags.
    if (empty($this->list_cache_tags)) {
        $this->list_cache_tags = [
            'config:' . $definition['id'] . '_list',
        ];
    }
    parent::__construct($definition);
    // Always add a default 'uuid' key.
    $this->entity_keys['uuid'] = 'uuid';
    $this->entity_keys['langcode'] = 'langcode';
    $this->handlers += [
        'storage' => 'Drupal\\Core\\Config\\Entity\\ConfigEntityStorage',
    ];
    $this->lookup_keys[] = 'uuid';
}

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