function EntityTypeManager::getHandler
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::getHandler()
- 10 core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::getHandler()
- 11.x core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::getHandler()
Overrides EntityTypeManagerInterface::getHandler
4 calls to EntityTypeManager::getHandler()
- EntityTypeManager::getAccessControlHandler in core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php - Creates a new access control handler instance.
- EntityTypeManager::getListBuilder in core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php - Creates a new entity list builder.
- EntityTypeManager::getStorage in core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php - Creates a new storage instance.
- EntityTypeManager::getViewBuilder in core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php - Creates a new view builder instance.
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php, line 267
Class
- EntityTypeManager
- Manages entity type plugin definitions.
Namespace
Drupal\Core\EntityCode
public function getHandler($entity_type_id, $handler_type) {
if (!isset($this->handlers[$handler_type][$entity_type_id])) {
$definition = $this->getDefinition($entity_type_id);
$class = $definition->getHandlerClass($handler_type);
if (!$class) {
throw new InvalidPluginDefinitionException($entity_type_id, sprintf('The "%s" entity type did not specify a %s handler.', $entity_type_id, $handler_type));
}
$this->handlers[$handler_type][$entity_type_id] = $this->createHandlerInstance($class, $definition);
}
return $this->handlers[$handler_type][$entity_type_id];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.