public function ContentEntityStorageBase::__construct

public ContentEntityStorageBase::__construct(EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, CacheBackendInterface $cache)

Constructs a ContentEntityStorageBase object.

Parameters

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

\Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager.

\Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend to be used.

Overrides EntityStorageBase::__construct

File

core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php, line 47

Class

ContentEntityStorageBase
Base class for content entity storage handlers.

Namespace

Drupal\Core\Entity

Code

public function __construct(EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, CacheBackendInterface $cache) {
  parent::__construct($entity_type);
  $this->bundleKey = $this->entityType->getKey('bundle');
  $this->entityManager = $entity_manager;
  $this->cacheBackend = $cache;
}

© 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!ContentEntityStorageBase.php/function/ContentEntityStorageBase::__construct/8.1.x