You are here

public function EntityManagerWrapper::createHandlerInstance in Devel 4.x

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Entity/EntityManagerWrapper.php \Drupal\webprofiler\Entity\EntityManagerWrapper::createHandlerInstance()
  2. 8 webprofiler/src/Entity/EntityManagerWrapper.php \Drupal\webprofiler\Entity\EntityManagerWrapper::createHandlerInstance()
  3. 8.2 webprofiler/src/Entity/EntityManagerWrapper.php \Drupal\webprofiler\Entity\EntityManagerWrapper::createHandlerInstance()

Creates new handler instance.

Usually \Drupal\Core\Entity\EntityTypeManagerInterface::getHandler() is preferred since that method has additional checking that the class exists and has static caches.

Parameters

mixed $class: The handler class to instantiate.

\Drupal\Core\Entity\EntityTypeInterface $definition: The entity type definition.

Return value

object A handler instance.

Overrides EntityTypeManagerInterface::createHandlerInstance

File

webprofiler/src/Entity/EntityManagerWrapper.php, line 204

Class

EntityManagerWrapper
Class EntityManagerWrapper.

Namespace

Drupal\webprofiler\Entity

Code

public function createHandlerInstance($class, EntityTypeInterface $definition = NULL) {
  return $this->entityTypeManager
    ->createHandlerInstance($class, $definition);
}