ControllerBase::entityManager

protected ControllerBase::entityManager()

Retrieves the entity manager service.

Return value

\Drupal\Core\Entity\EntityManagerInterface The entity manager service.

Deprecated

in Drupal 8.0.0, will be removed before Drupal 9.0.0. Most of the time static::entityTypeManager() is supposed to be used instead.

File

core/lib/Drupal/Core/Controller/ControllerBase.php, line 129

Class

ControllerBase
Utility base class for thin controllers.

Namespace

Drupal\Core\Controller

Code

protected function entityManager() {
  if (!$this->entityManager) {
    $this->entityManager = $this->container()->get('entity.manager');
  }
  return $this->entityManager;
}
doc_Drupal
2016-10-29 08:58:56
Comments
Leave a Comment

Please login to continue.