function EntityType::get
Same name in this branch
- 11.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::get()
- 11.x core/lib/Drupal/Core/Entity/Annotation/EntityType.php \Drupal\Core\Entity\Annotation\EntityType::get()
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::get()
- 9 core/lib/Drupal/Core/Entity/Annotation/EntityType.php \Drupal\Core\Entity\Annotation\EntityType::get()
- 8.9.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::get()
- 8.9.x core/lib/Drupal/Core/Entity/Annotation/EntityType.php \Drupal\Core\Entity\Annotation\EntityType::get()
- 10 core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::get()
- 10 core/lib/Drupal/Core/Entity/Annotation/EntityType.php \Drupal\Core\Entity\Annotation\EntityType::get()
Overrides AttributeBase::get
File
-
core/
lib/ Drupal/ Core/ Entity/ Attribute/ EntityType.php, line 67
Class
- EntityType
- Defines an entity type for plugin discovery.
Namespace
Drupal\Core\Entity\AttributeCode
public function get() : array|object {
// Use the specified entity type class, and remove it before instantiating.
$class = $this->entity_type_class;
$values = array_filter(get_object_vars($this) + [
'class' => $this->getClass(),
'provider' => $this->getProvider(),
], function ($value, $key) {
return !($value === NULL && ($key === 'deriver' || $key === 'provider' || $key == 'entity_type_class'));
}, ARRAY_FILTER_USE_BOTH);
return new $class($values);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.