Drupal 8  8.0.2
KeyValueEntityStorage Class Reference
Inheritance diagram for KeyValueEntityStorage:

Public Member Functions

 __construct (EntityTypeInterface $entity_type, KeyValueStoreInterface $key_value_store, UuidInterface $uuid_service, LanguageManagerInterface $language_manager)
 
 doCreate (array $values=array())
 
 doLoadMultiple (array $ids=NULL)
 
 loadRevision ($revision_id)
 
 deleteRevision ($revision_id)
 
 doDelete ($entities)
 
 save (EntityInterface $entity)
 
- Public Member Functions inherited from EntityStorageBase
 __construct (EntityTypeInterface $entity_type)
 
 getEntityTypeId ()
 
 getEntityType ()
 
 loadUnchanged ($id)
 
 resetCache (array $ids=NULL)
 
 create (array $values=array())
 
 load ($id)
 
 loadMultiple (array $ids=NULL)
 
 delete (array $entities)
 
 save (EntityInterface $entity)
 
 loadByProperties (array $values=array())
 
 getQuery ($conjunction= 'AND')
 
 getAggregateQuery ($conjunction= 'AND')
 
- Public Member Functions inherited from EntityHandlerBase
 setModuleHandler (ModuleHandlerInterface $module_handler)
 

Static Public Member Functions

static createInstance (ContainerInterface $container, EntityTypeInterface $entity_type)
 

Data Fields

const MAX_ID_LENGTH = 128
 
- Data Fields inherited from EntityStorageInterface
const FIELD_LOAD_CURRENT = 'FIELD_LOAD_CURRENT'
 
const FIELD_LOAD_REVISION = 'FIELD_LOAD_REVISION'
 

Protected Member Functions

 doSave ($id, EntityInterface $entity)
 
 has ($id, EntityInterface $entity)
 
 getQueryServiceName ()
 
- Protected Member Functions inherited from EntityStorageBase
 getFromStaticCache (array $ids)
 
 setStaticCache (array $entities)
 
 invokeHook ($hook, EntityInterface $entity)
 
 doCreate (array $values)
 
 doLoadMultiple (array $ids=NULL)
 
 postLoad (array &$entities)
 
 mapFromStorageRecords (array $records)
 
 has ($id, EntityInterface $entity)
 
 doDelete ($entities)
 
 doPreSave (EntityInterface $entity)
 
 doSave ($id, EntityInterface $entity)
 
 doPostSave (EntityInterface $entity, $update)
 
 buildPropertyQuery (QueryInterface $entity_query, array $values)
 
 getQueryServiceName ()
 
- Protected Member Functions inherited from EntityHandlerBase
 moduleHandler ()
 

Protected Attributes

 $keyValueStore
 
 $uuidService
 
 $languageManager
 
- Protected Attributes inherited from EntityStorageBase
 $entities = array()
 
 $entityTypeId
 
 $entityType
 
 $idKey
 
 $uuidKey
 
 $langcodeKey
 
 $uuidService
 
 $entityClass
 
- Protected Attributes inherited from EntityHandlerBase
 $moduleHandler
 

Detailed Description

Provides a key value backend for entities.

Todo:

Entities that depend on auto-incrementing serial IDs need to explicitly provide an ID until a generic wrapper around the functionality provided by ::nextId() is added and used.

Revisions are currently not supported.

Constructor & Destructor Documentation

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

Constructs a new KeyValueEntityStorage.

Parameters
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type.
\Drupal\Core\KeyValueStore\KeyValueStoreInterface$key_value_storeThe key value store.
\Drupal\Component\Uuid\UuidInterface$uuid_serviceThe UUID service.
\Drupal\Core\Language\LanguageManagerInterface$language_managerThe language manager.

References Drupal\languageManager().

Here is the call graph for this function:

Member Function Documentation

static createInstance ( ContainerInterface  $container,
EntityTypeInterface  $entity_type 
)
static

{Instantiates a new instance of this entity handler.This is a factory method that returns a new instance of this object. The factory should pass any needed dependencies into the constructor of this object, but not the container itself. Every call to this method must return a new instance of this object; that is, it may not implement a singleton.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe service container this object should use.
\Drupal\Core\Entity\EntityTypeInterface$entity_typeThe entity type definition.
Returns
static A new instance of the entity handler.
}

Implements EntityHandlerInterface.

References EntityTypeInterface\get(), and EntityTypeInterface\id().

Here is the call graph for this function:

deleteRevision (   $revision_id)

{Delete a specific entity revision.A revision can only be deleted if it's not the currently active one.

Parameters
int$revision_idThe revision id.
}

Implements EntityStorageInterface.

doCreate ( array  $values = array())

{}

References EntityStorageBase\getEntityType(), and Drupal\languageManager().

Here is the call graph for this function:

doDelete (   $entities)

{}

doLoadMultiple ( array  $ids = NULL)

{}

References EntityStorageBase\mapFromStorageRecords().

Here is the call graph for this function:

doSave (   $id,
EntityInterface  $entity 
)
protected

{}

References KeyValueEntityStorage\has(), EntityInterface\id(), EntityInterface\isNew(), and EntityInterface\toArray().

Here is the call graph for this function:

getQueryServiceName ( )
protected

{}

has (   $id,
EntityInterface  $entity 
)
protected

{}

Referenced by KeyValueEntityStorage\doSave().

Here is the caller graph for this function:

loadRevision (   $revision_id)

{Load a specific entity revision.

Parameters
int | string$revision_idThe revision id.
Returns
|null The specified entity revision or NULL if not found.
}

Implements EntityStorageInterface.

save ( EntityInterface  $entity)

{Saves the entity permanently.

Parameters
\Drupal\Core\Entity\EntityInterface$entityThe entity to save.
Returns
SAVED_NEW or SAVED_UPDATED is returned depending on the operation performed.
Exceptions
\Drupal\Core\Entity\EntityStorageExceptionIn case of failures, an exception is thrown.
}

Implements EntityStorageInterface.

References EntityInterface\id().

Here is the call graph for this function:

Field Documentation

const MAX_ID_LENGTH = 128

Length limit of the entity ID.


The documentation for this class was generated from the following file: