ContentEntityStorageInterface
interface ContentEntityStorageInterface implements EntityStorageInterface, TranslatableRevisionableStorageInterface (View source)
A storage that supports content entity types.
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.
Constructs a new entity translation object, without permanently saving it.
Creates a new revision starting off from the specified entity object.
Loads multiple entity revisions.
Returns the latest revision identifier for an entity.
Returns the latest revision affecting the specified translation.
Creates an entity with sample field values.
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.
ContentEntityInterface
createTranslation(ContentEntityInterface $entity, string $langcode, array $values = [])
Constructs a new entity translation object, without permanently saving it.
RevisionableInterface
createRevision(RevisionableInterface $entity, bool $default = TRUE)
Creates a new revision starting off from the specified entity object.
RevisionableInterface[]
loadMultipleRevisions(array $revision_ids)
Loads multiple entity revisions.
int|string|null
getLatestRevisionId(int|string $entity_id)
Returns the latest revision identifier for an entity.
int|string|null
getLatestTranslationAffectedRevisionId(int|string $entity_id, string $langcode)
Returns the latest revision affecting the specified translation.
FieldableEntityInterface
createWithSampleValues(string|bool $bundle = FALSE, array $values = [])
Creates an entity with sample field values.