function EntityType::get

Same name in this branch
  1. 11.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::get()
Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::get()
  2. 9 core/lib/Drupal/Core/Entity/Annotation/EntityType.php \Drupal\Core\Entity\Annotation\EntityType::get()
  3. 8.9.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::get()
  4. 8.9.x core/lib/Drupal/Core/Entity/Annotation/EntityType.php \Drupal\Core\Entity\Annotation\EntityType::get()
  5. 10 core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::get()
  6. 10 core/lib/Drupal/Core/Entity/Annotation/EntityType.php \Drupal\Core\Entity\Annotation\EntityType::get()

Overrides Plugin::get

2 calls to EntityType::get()
ConfigEntityType::get in core/lib/Drupal/Core/Entity/Annotation/ConfigEntityType.php
Gets the value of an annotation.
ContentEntityType::get in core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
Gets the value of an annotation.
2 methods override EntityType::get()
ConfigEntityType::get in core/lib/Drupal/Core/Entity/Annotation/ConfigEntityType.php
Gets the value of an annotation.
ContentEntityType::get in core/lib/Drupal/Core/Entity/Annotation/ContentEntityType.php
Gets the value of an annotation.

File

core/lib/Drupal/Core/Entity/Annotation/EntityType.php, line 53

Class

EntityType
Defines an Entity type annotation object.

Namespace

Drupal\Core\Entity\Annotation

Code

public function get() {
    $values = $this->definition;
    // Use the specified entity type class, and remove it before instantiating.
    $class = $values['entity_type_class'];
    unset($values['entity_type_class']);
    return new $class($values);
}

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