function EntityTypeManager::createHandlerInstance
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::createHandlerInstance()
- 10 core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::createHandlerInstance()
- 11.x core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::createHandlerInstance()
Overrides EntityTypeManagerInterface::createHandlerInstance
2 calls to EntityTypeManager::createHandlerInstance()
- EntityTypeManager::getHandler in core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php - Returns a handler instance for the given entity type and handler.
- EntityTypeManager::getRouteProviders in core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php - Gets all route provider instances.
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php, line 267
Class
- EntityTypeManager
- Manages entity type plugin definitions.
Namespace
Drupal\Core\EntityCode
public function createHandlerInstance($class, EntityTypeInterface $definition = NULL) {
if (is_subclass_of($class, 'Drupal\\Core\\Entity\\EntityHandlerInterface')) {
$handler = $class::createInstance($this->container, $definition);
}
else {
$handler = new $class($definition);
}
if (method_exists($handler, 'setModuleHandler')) {
$handler->setModuleHandler($this->moduleHandler);
}
if (method_exists($handler, 'setStringTranslation')) {
$handler->setStringTranslation($this->stringTranslation);
}
return $handler;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.