W3cubDocs

/Drupal 8

protected function Entity::entityManager

protected Entity::entityManager()

Gets the entity manager.

Return value

\Drupal\Core\Entity\EntityManagerInterface

Deprecated

in Drupal 8.0.0 and will be removed before 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/Entity.php, line 77

Class

Entity
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

protected function entityManager() {
  return \Drupal::entityManager();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Entity.php/function/Entity::entityManager/8.1.x