CachedEntityPersister
extends
CachedPersister, EntityPersister
in
Interface for second level cache entity persisters.
Table of Contents
- addInsert() : void
- Adds an entity to the queued insertions.
- afterTransactionComplete() : mixed
- Perform whatever processing is encapsulated here after completion of the transaction.
- afterTransactionRolledBack() : mixed
- Perform whatever processing is encapsulated here after completion of the rolled-back.
- count() : int
- Count entities (optionally filtered by a criteria)
- delete() : bool
- Deletes a managed entity.
- executeInserts() : mixed
- Executes all queued entity insertions and returns any generated post-insert identifiers that were created as a result of the insertions.
- exists() : bool
- Checks whether the given managed entity exists in the database.
- expandCriteriaParameters() : mixed
- Expands Criteria Parameters by walking the expressions and grabbing all parameters and types from it.
- expandParameters() : mixed
- Expands the parameters from the given criteria and use the correct binding types if found.
- getCacheRegion() : Region
- Gets the The region access.
- getClassMetadata() : ClassMetadata
- getCountSQL() : string
- Get the COUNT SQL to count entities (optionally based on a criteria)
- getEntityHydrator() : EntityHydrator
- getInserts() : mixed
- Get all queued inserts.
- getInsertSQL() : string
- getManyToManyCollection() : array<string|int, mixed>
- Gets (sliced or full) elements of the given collection.
- getOneToManyCollection() : array<string|int, mixed>
- Returns an array with (sliced or full list) of elements in the specified collection.
- getOwningTable() : string
- Gets the name of the table that owns the column the given field is mapped to.
- getResultSetMapping() : ResultSetMapping
- Gets the ResultSetMapping used for hydration.
- getSelectConditionStatementSQL() : string
- Gets the SQL WHERE condition for matching a field with a given value.
- getSelectSQL() : string
- Gets the SELECT SQL to select one or more entities by a set of field criteria.
- load() : object|null
- Loads an entity by a list of field criteria.
- loadAll() : mixed
- Loads a list of entities by a list of field criteria.
- loadById() : object|null
- Loads an entity by identifier.
- loadCriteria() : array<string|int, mixed>
- Loads Entities matching the given Criteria object.
- loadManyToManyCollection() : array<string|int, mixed>
- Loads a collection of entities of a many-to-many association.
- loadOneToManyCollection() : mixed
- Loads a collection of entities in a one-to-many association.
- loadOneToOneEntity() : object
- Loads an entity of this persister's mapped class as part of a single-valued association from another entity.
- lock() : void
- Locks all rows of this entity matching the given criteria with the specified pessimistic lock mode.
- refresh() : void
- Refreshes a managed entity.
- storeEntityCache() : bool
- update() : void
- Updates a managed entity. The entity is updated according to its current changeset in the running UnitOfWork. If there is no changeset, nothing is updated.
Methods
addInsert()
Adds an entity to the queued insertions.
public
addInsert(object $entity) : void
Parameters
- $entity : object
-
The entity to queue for insertion.
Return values
void —afterTransactionComplete()
Perform whatever processing is encapsulated here after completion of the transaction.
public
afterTransactionComplete() : mixed
Return values
mixed —afterTransactionRolledBack()
Perform whatever processing is encapsulated here after completion of the rolled-back.
public
afterTransactionRolledBack() : mixed
Return values
mixed —count()
Count entities (optionally filtered by a criteria)
public
count([array<string|int, mixed>|Criteria $criteria = [] ]) : int
Parameters
- $criteria : array<string|int, mixed>|Criteria = []
Return values
int —delete()
Deletes a managed entity.
public
delete(object $entity) : bool
The entity to delete must be managed and have a persistent identifier. The deletion happens instantaneously.
Subclasses may override this method to customize the semantics of entity deletion.
Parameters
- $entity : object
-
The entity to delete.
Return values
bool —TRUE if the entity got deleted in the database, FALSE otherwise.
executeInserts()
Executes all queued entity insertions and returns any generated post-insert identifiers that were created as a result of the insertions.
public
executeInserts() : mixed
If no inserts are queued, invoking this method is a NOOP.
Tags
Return values
mixed —exists()
Checks whether the given managed entity exists in the database.
public
exists(object $entity[, Criteria|null $extraConditions = null ]) : bool
Parameters
- $entity : object
- $extraConditions : Criteria|null = null
Return values
bool —TRUE if the entity exists in the database, FALSE otherwise.
expandCriteriaParameters()
Expands Criteria Parameters by walking the expressions and grabbing all parameters and types from it.
public
expandCriteriaParameters(Criteria $criteria) : mixed
Parameters
- $criteria : Criteria
Tags
Return values
mixed —expandParameters()
Expands the parameters from the given criteria and use the correct binding types if found.
public
expandParameters(array<string|int, string> $criteria) : mixed
Parameters
- $criteria : array<string|int, string>
Tags
Return values
mixed —getCacheRegion()
Gets the The region access.
public
getCacheRegion() : Region
Return values
Region —getClassMetadata()
public
getClassMetadata() : ClassMetadata
Return values
ClassMetadata —getCountSQL()
Get the COUNT SQL to count entities (optionally based on a criteria)
public
getCountSQL([array<string|int, mixed>|Criteria $criteria = [] ]) : string
Parameters
- $criteria : array<string|int, mixed>|Criteria = []
Return values
string —getEntityHydrator()
public
getEntityHydrator() : EntityHydrator
Return values
EntityHydrator —getInserts()
Get all queued inserts.
public
getInserts() : mixed
Tags
Return values
mixed —getInsertSQL()
public
getInsertSQL() : string
Tags
Return values
string —getManyToManyCollection()
Gets (sliced or full) elements of the given collection.
public
getManyToManyCollection(array<string|int, mixed> $assoc, object $sourceEntity[, int|null $offset = null ][, int|null $limit = null ]) : array<string|int, mixed>
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : object
- $offset : int|null = null
- $limit : int|null = null
Tags
Return values
array<string|int, mixed> —getOneToManyCollection()
Returns an array with (sliced or full list) of elements in the specified collection.
public
getOneToManyCollection(array<string|int, mixed> $assoc, object $sourceEntity[, int|null $offset = null ][, int|null $limit = null ]) : array<string|int, mixed>
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : object
- $offset : int|null = null
- $limit : int|null = null
Tags
Return values
array<string|int, mixed> —getOwningTable()
Gets the name of the table that owns the column the given field is mapped to.
public
getOwningTable(string $fieldName) : string
The default implementation in BasicEntityPersister always returns the name of the table the entity type of this persister is mapped to, since an entity is always persisted to a single table with a BasicEntityPersister.
Parameters
- $fieldName : string
-
The field name.
Return values
string —The table name.
getResultSetMapping()
Gets the ResultSetMapping used for hydration.
public
getResultSetMapping() : ResultSetMapping
Return values
ResultSetMapping —getSelectConditionStatementSQL()
Gets the SQL WHERE condition for matching a field with a given value.
public
getSelectConditionStatementSQL(string $field, mixed $value[, array<string|int, mixed>|null $assoc = null ][, string|null $comparison = null ]) : string
Parameters
- $field : string
- $value : mixed
- $assoc : array<string|int, mixed>|null = null
- $comparison : string|null = null
Tags
Return values
string —getSelectSQL()
Gets the SELECT SQL to select one or more entities by a set of field criteria.
public
getSelectSQL(array<string|int, mixed>|Criteria $criteria[, array<string|int, mixed>|null $assoc = null ][, int|null $lockMode = null ][, int|null $limit = null ][, int|null $offset = null ][, array<string|int, mixed>|null $orderBy = null ]) : string
Parameters
- $criteria : array<string|int, mixed>|Criteria
- $assoc : array<string|int, mixed>|null = null
- $lockMode : int|null = null
- $limit : int|null = null
- $offset : int|null = null
- $orderBy : array<string|int, mixed>|null = null
Return values
string —load()
Loads an entity by a list of field criteria.
public
load(array<string|int, mixed> $criteria[, object|null $entity = null ][, array<string|int, mixed>|null $assoc = null ][, array<string|int, mixed> $hints = [] ][, int|null $lockMode = null ][, int|null $limit = null ][, array<string|int, string>|null $orderBy = null ]) : object|null
Parameters
- $criteria : array<string|int, mixed>
-
The criteria by which to load the entity.
- $entity : object|null = null
-
The entity to load the data into. If not specified, a new entity is created.
- $assoc : array<string|int, mixed>|null = null
-
The association that connects the entity to load to another entity, if any.
- $hints : array<string|int, mixed> = []
-
Hints for entity creation.
- $lockMode : int|null = null
-
One of the \Doctrine\DBAL\LockMode::* constants or NULL if no specific lock mode should be used for loading the entity.
- $limit : int|null = null
-
Limit number of results.
- $orderBy : array<string|int, string>|null = null
-
Criteria to order by.
Tags
Return values
object|null —The loaded and managed entity instance or NULL if the entity can not be found.
loadAll()
Loads a list of entities by a list of field criteria.
public
loadAll([array<string|int, mixed> $criteria = [] ][, array<string|int, mixed>|null $orderBy = null ][, int|null $limit = null ][, int|null $offset = null ]) : mixed
Parameters
- $criteria : array<string|int, mixed> = []
- $orderBy : array<string|int, mixed>|null = null
- $limit : int|null = null
- $offset : int|null = null
Tags
Return values
mixed —loadById()
Loads an entity by identifier.
public
loadById(array<string|int, mixed> $identifier[, object|null $entity = null ]) : object|null
Parameters
- $identifier : array<string|int, mixed>
- $entity : object|null = null
-
The entity to load the data into. If not specified, a new entity is created.
Tags
Return values
object|null —The loaded and managed entity instance or NULL if the entity can not be found.
loadCriteria()
Loads Entities matching the given Criteria object.
public
loadCriteria(Criteria $criteria) : array<string|int, mixed>
Parameters
- $criteria : Criteria
Return values
array<string|int, mixed> —loadManyToManyCollection()
Loads a collection of entities of a many-to-many association.
public
loadManyToManyCollection(array<string|int, mixed> $assoc, object $sourceEntity, PersistentCollection $collection) : array<string|int, mixed>
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : object
-
The entity that owns the collection.
- $collection : PersistentCollection
-
The collection to fill.
Tags
Return values
array<string|int, mixed> —loadOneToManyCollection()
Loads a collection of entities in a one-to-many association.
public
loadOneToManyCollection(array<string|int, mixed> $assoc, object $sourceEntity, PersistentCollection $collection) : mixed
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : object
- $collection : PersistentCollection
-
The collection to load/fill.
Tags
Return values
mixed —loadOneToOneEntity()
Loads an entity of this persister's mapped class as part of a single-valued association from another entity.
public
loadOneToOneEntity(array<string|int, mixed> $assoc, object $sourceEntity[, array<string|int, mixed> $identifier = [] ]) : object
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : object
-
The entity that owns the association (not necessarily the "owning side").
- $identifier : array<string|int, mixed> = []
Tags
Return values
object —The loaded and managed entity instance or NULL if the entity can not be found.
lock()
Locks all rows of this entity matching the given criteria with the specified pessimistic lock mode.
public
lock(array<string|int, mixed> $criteria, int $lockMode) : void
Parameters
- $criteria : array<string|int, mixed>
- $lockMode : int
-
One of the Doctrine\DBAL\LockMode::* constants.
Tags
Return values
void —refresh()
Refreshes a managed entity.
public
refresh(array<string|int, mixed> $id, object $entity[, int|null $lockMode = null ]) : void
Parameters
- $id : array<string|int, mixed>
- $entity : object
-
The entity to refresh.
- $lockMode : int|null = null
-
One of the \Doctrine\DBAL\LockMode::* constants or NULL if no specific lock mode should be used for refreshing the managed entity.
Tags
Return values
void —storeEntityCache()
public
storeEntityCache(object $entity, EntityCacheKey $key) : bool
Parameters
- $entity : object
- $key : EntityCacheKey
Return values
bool —update()
Updates a managed entity. The entity is updated according to its current changeset in the running UnitOfWork. If there is no changeset, nothing is updated.
public
update(object $entity) : void
Parameters
- $entity : object
-
The entity to update.