You are here

protected function FieldAPIHandlerTrait::getEntityManager in Drupal 8

Returns the entity manager.

Return value

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

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\views\FieldAPIHandlerTrait::getEntityFieldManager() instead.

See also

https://www.drupal.org/node/2549139

File

core/modules/views/src/FieldAPIHandlerTrait.php, line 79

Class

FieldAPIHandlerTrait
A trait containing helper methods for field definitions.

Namespace

Drupal\views

Code

protected function getEntityManager() {
  @trigger_error(__METHOD__ . ' is deprecated in drupal:8.8.0 and is removed in drupal:9.0.0. Use \\Drupal\\views\\FieldAPIHandlerTrait::getEntityFieldManager() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  if (!isset($this->entityManager)) {
    $this->entityManager = \Drupal::entityManager();
  }
  return $this->entityManager;
}