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');
}
doc_Drupal
2016-10-29 09:21:47
Comments
Leave a Comment

Please login to continue.