SqlEntityStorageInterface
interface SqlEntityStorageInterface implements EntityStorageInterface (View source)
A common interface for SQL-based entity storage implementations.
Methods
Loads one or more entities.
Loads an unchanged entity from the database.
Load a specific entity revision.
Load entities by their property values.
Constructs a new entity object, without permanently saving it.
Gets an entity query instance.
Gets an aggregated query instance.
Retrieves the class name used to create the entity.
Gets a table mapping for the entity's SQL tables.
Details
resetCache(array $ids = NULL)
Resets the internal entity cache.
EntityInterface[]
loadMultiple(array $ids = NULL)
Loads one or more entities.
EntityInterface|null
load(mixed $id)
Loads one entity.
EntityInterface|null
loadUnchanged(mixed $id)
Loads an unchanged entity from the database.
EntityInterface|null
loadRevision(int|string $revision_id)
Load a specific entity revision.
deleteRevision(int $revision_id)
Delete a specific entity revision.
A revision can only be deleted if it's not the currently active one.
EntityInterface[]
loadByProperties(array $values = [])
Load entities by their property values.
EntityInterface
create(array $values = [])
Constructs a new entity object, without permanently saving it.
delete(array $entities)
Deletes permanently saved entities.
SAVED_NEW
save(EntityInterface $entity)
Saves the entity permanently.
restore(EntityInterface $entity)
| internal | This method should never be used to perform a regular entity save. Its only use-case is to assist updating entity types when there are complex schema changes, for example, to make them revisionable. Note that overriding this method to fix data prior to restoring is a likely sign that the current data is corrupt. |
Restores a previously saved entity.
Note that the entity is assumed to be in a valid state for the storage, so the restore process does not invoke any hooks, nor does it perform any pre or post-save operations.
bool
hasData()
Determines if the storage contains any data.
QueryInterface
getQuery(string $conjunction = 'AND')
Gets an entity query instance.
QueryAggregateInterface
getAggregateQuery(string $conjunction = 'AND')
Gets an aggregated query instance.
string
getEntityTypeId()
Gets the entity type ID.
EntityTypeInterface
getEntityType()
Gets the entity type definition.
string
getEntityClass(string|null $bundle = NULL)
Retrieves the class name used to create the entity.
TableMappingInterface
getTableMapping(array $storage_definitions = NULL)
Gets a table mapping for the entity's SQL tables.