function 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.