public function KeyValueEntityStorage::__construct

public KeyValueEntityStorage::__construct(EntityTypeInterface $entity_type, KeyValueStoreInterface $key_value_store, UuidInterface $uuid_service, LanguageManagerInterface $language_manager)

Constructs a new KeyValueEntityStorage.

Parameters

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

\Drupal\Core\KeyValueStore\KeyValueStoreInterface $key_value_store: The key value store.

\Drupal\Component\Uuid\UuidInterface $uuid_service: The UUID service.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

Overrides EntityStorageBase::__construct

File

core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php, line 64

Class

KeyValueEntityStorage
Provides a key value backend for entities.

Namespace

Drupal\Core\Entity\KeyValueStore

Code

public function __construct(EntityTypeInterface $entity_type, KeyValueStoreInterface $key_value_store, UuidInterface $uuid_service, LanguageManagerInterface $language_manager) {
  parent::__construct($entity_type);
  $this->keyValueStore = $key_value_store;
  $this->uuidService = $uuid_service;
  $this->languageManager = $language_manager;

  // Check if the entity type supports UUIDs.
  $this->uuidKey = $this->entityType->getKey('uuid');
}

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