You are here

protected function EntityBase::entityManager in Drupal 8

Gets the entity manager.

Return value

\Drupal\Core\Entity\EntityManagerInterface

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::entityTypeManager() instead in most cases. If the needed method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the deprecated \Drupal\Core\Entity\EntityManager to find the correct interface or service.

File

core/lib/Drupal/Core/Entity/EntityBase.php, line 78

Class

EntityBase
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

protected function entityManager() {
  @trigger_error('Entity::getEntityManager() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use ::getEntityTypeManager() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  return \Drupal::entityManager();
}