interface CachedEntityPersister implements CachedPersister, EntityPersister (View source)

Interface for second level cache entity persisters.

Methods

afterTransactionComplete()

Perform whatever processing is encapsulated here after completion of the transaction.

afterTransactionRolledBack()

Perform whatever processing is encapsulated here after completion of the rolled-back.

getCacheRegion()

Gets the The region access.

getResultSetMapping()

Gets the ResultSetMapping used for hydration.

mixed[]
getIdentifier(object $entity)

Extracts the identifier values of an entity that relies on this persister.

setIdentifier(object $entity, array $id)

Populates the entity identifier of an entity.

mixed|null
getColumnValue($entity, string $columnName)

No description

string
getSelectSQL($criteria, AssociationMetadata|null $association = null, $lockMode = null, $limit = null, $offset = null, array $orderBy = [])

Gets the SELECT SQL to select one or more entities by a set of field criteria.

string
getCountSQL(Criteria|mixed[] $criteria = [])

Get the COUNT SQL to count entities (optionally based on a criteria)

mixed[][]
expandParameters(mixed[] $criteria)

Expands the parameters from the given criteria and use the correct binding types if found.

mixed[][]
expandCriteriaParameters(Criteria $criteria)

Expands Criteria Parameters by walking the expressions and grabbing all parameters and types from it.

string
getSelectConditionStatementSQL($field, $value, AssociationMetadata|null $association = null, $comparison = null)

Gets the SQL WHERE condition for matching a field with a given value.

void
insert($entity)

Inserts an entity. Returns any generated post-insert identifiers that were created as a result of the insertion.

void
update(object $entity)

Updates a managed entity. The entity is updated according to its current changeset in the running UnitOfWork.

bool
delete(object $entity)

Deletes a managed entity.

int
count(Criteria[]|Criteria $criteria = [])

Count entities (optionally filtered by a criteria)

void
lock(array $criteria, int $lockMode)

Locks all rows of this entity matching the given criteria with the specified pessimistic lock mode.

bool
exists($entity, Criteria|null $extraConditions = null)

Checks whether the given managed entity exists in the database.

void
refresh(array $id, object $entity, int|null $lockMode = null)

Refreshes a managed entity.

object|null
load(array $criteria, object|null $entity = null, AssociationMetadata|null $association = null, array $hints = [], int|null $lockMode = null, int|null $limit = null, array $orderBy = [])

Loads an entity by a list of field criteria.

object
loadById(array $identifier, object|null $entity = null)

Loads an entity by identifier.

mixed[]
loadCriteria(Criteria $criteria)

Loads Entities matching the given Criteria object.

mixed[]
loadAll(array $criteria = [], array $orderBy = [], int|null $limit = null, int|null $offset = null)

Loads a list of entities by a list of field criteria.

object
loadToOneEntity(ToOneAssociationMetadata $association, object $sourceEntity, array $identifier = [])

Loads an entity of this persister's mapped class as part of a single-valued association from another entity.

mixed[]
getOneToManyCollection(OneToManyAssociationMetadata $association, object $sourceEntity, int|null $offset = null, int|null $limit = null)

Returns an array with (sliced or full list) of elements in the specified collection.

mixed[]
loadOneToManyCollection(OneToManyAssociationMetadata $association, object $sourceEntity, PersistentCollection $collection)

Loads a collection of entities in a one-to-many association.

mixed[]
getManyToManyCollection(ManyToManyAssociationMetadata $association, object $sourceEntity, int|null $offset = null, int|null $limit = null)

Gets (sliced or full) elements of the given collection.

mixed[]
loadManyToManyCollection(ManyToManyAssociationMetadata $association, object $sourceEntity, PersistentCollection $collection)

Loads a collection of entities of a many-to-many association.

bool
storeEntityCache($entity, EntityCacheKey $key)

No description

Details

afterTransactionComplete()

Perform whatever processing is encapsulated here after completion of the transaction.

afterTransactionRolledBack()

Perform whatever processing is encapsulated here after completion of the rolled-back.

Region getCacheRegion()

Gets the The region access.

Return Value

Region

ClassMetadata getClassMetadata()

Return Value

ClassMetadata

ResultSetMapping getResultSetMapping()

Gets the ResultSetMapping used for hydration.

Return Value

ResultSetMapping

mixed[] getIdentifier(object $entity)

Extracts the identifier values of an entity that relies on this persister.

For composite identifiers, the identifier values are returned as an array with the same order as the field order in {@link ClassMetadata#identifier}.

Parameters

object $entity

Return Value

mixed[]

setIdentifier(object $entity, array $id)

Populates the entity identifier of an entity.

Parameters

object $entity
array $id

mixed|null getColumnValue($entity, string $columnName)

Parameters

$entity
string $columnName

Return Value

mixed|null

string getSelectSQL($criteria, AssociationMetadata|null $association = null, $lockMode = null, $limit = null, $offset = null, array $orderBy = [])

Gets the SELECT SQL to select one or more entities by a set of field criteria.

Parameters

$criteria
AssociationMetadata|null $association
$lockMode
$limit
$offset
array $orderBy

Return Value

string

string getCountSQL(Criteria|mixed[] $criteria = [])

Get the COUNT SQL to count entities (optionally based on a criteria)

Parameters

Criteria|mixed[] $criteria

Return Value

string

mixed[][] expandParameters(mixed[] $criteria)

Expands the parameters from the given criteria and use the correct binding types if found.

Parameters

mixed[] $criteria

Return Value

mixed[][]

mixed[][] expandCriteriaParameters(Criteria $criteria)

Expands Criteria Parameters by walking the expressions and grabbing all parameters and types from it.

Parameters

Criteria $criteria

Return Value

mixed[][]

string getSelectConditionStatementSQL($field, $value, AssociationMetadata|null $association = null, $comparison = null)

Gets the SQL WHERE condition for matching a field with a given value.

Parameters

$field
$value
AssociationMetadata|null $association
$comparison

Return Value

string

void insert($entity)

Inserts an entity. Returns any generated post-insert identifiers that were created as a result of the insertion.

The insertion happens instantaneously.

Subclasses may override this method to customize the semantics of entity deletion.

Parameters

$entity

Return Value

void

void update(object $entity)

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.

Subclasses may override this method to customize the semantics of entity update.

Parameters

object $entity The entity to update.

Return Value

void

bool delete(object $entity)

Deletes a managed entity.

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

object $entity The entity to delete.

Return Value

bool TRUE if the entity got deleted in the database, FALSE otherwise.

int count(Criteria[]|Criteria $criteria = [])

Count entities (optionally filtered by a criteria)

Parameters

Criteria[]|Criteria $criteria

Return Value

int

void lock(array $criteria, int $lockMode)

Locks all rows of this entity matching the given criteria with the specified pessimistic lock mode.

Parameters

array $criteria
int $lockMode One of the Doctrine\DBAL\LockMode::* constants.

Return Value

void

bool exists($entity, Criteria|null $extraConditions = null)

Checks whether the given managed entity exists in the database.

Parameters

$entity
Criteria|null $extraConditions

Return Value

bool TRUE if the entity exists in the database, FALSE otherwise.

void refresh(array $id, object $entity, int|null $lockMode = null)

Refreshes a managed entity.

Parameters

array $id The identifier of the entity as an associative array from column or field names to values.
object $entity The entity to refresh.
int|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants or NULL if no specific lock mode should be used for refreshing the managed entity.

Return Value

void

object|null load(array $criteria, object|null $entity = null, AssociationMetadata|null $association = null, array $hints = [], int|null $lockMode = null, int|null $limit = null, array $orderBy = [])

Loads an entity by a list of field criteria.

Parameters

array $criteria The criteria by which to load the entity.
object|null $entity The entity to load the data into. If not specified, a new entity is created.
AssociationMetadata|null $association The association that connects the entity to load to another entity, if any.
array $hints Hints for entity creation.
int|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants or NULL if no specific lock mode should be used for loading the entity.
int|null $limit Limit number of results.
array $orderBy Criteria to order by.

Return Value

object|null The loaded and managed entity instance or NULL if the entity can not be found.

object loadById(array $identifier, object|null $entity = null)

Loads an entity by identifier.

Parameters

array $identifier The entity identifier.
object|null $entity The entity to load the data into. If not specified, a new entity is created.

Return Value

object The loaded and managed entity instance or NULL if the entity can not be found.

mixed[] loadCriteria(Criteria $criteria)

Loads Entities matching the given Criteria object.

Parameters

Criteria $criteria

Return Value

mixed[]

mixed[] loadAll(array $criteria = [], array $orderBy = [], int|null $limit = null, int|null $offset = null)

Loads a list of entities by a list of field criteria.

Parameters

array $criteria
array $orderBy
int|null $limit Limit number of results.
int|null $offset

Return Value

mixed[]

object loadToOneEntity(ToOneAssociationMetadata $association, object $sourceEntity, array $identifier = [])

Loads an entity of this persister's mapped class as part of a single-valued association from another entity.

Parameters

ToOneAssociationMetadata $association The association to load.
object $sourceEntity The entity that owns the association (not necessarily the "owning side").
array $identifier The identifier of the entity to load. Must be provided if the association to load represents the owning side, otherwise the identifier is derived from the $sourceEntity.

Return Value

object The loaded and managed entity instance or NULL if the entity can not be found.

Exceptions

MappingException

mixed[] getOneToManyCollection(OneToManyAssociationMetadata $association, object $sourceEntity, int|null $offset = null, int|null $limit = null)

Returns an array with (sliced or full list) of elements in the specified collection.

Parameters

OneToManyAssociationMetadata $association The association mapping of the association being loaded.
object $sourceEntity The entity that owns the collection.
int|null $offset
int|null $limit Limit number of results.

Return Value

mixed[]

mixed[] loadOneToManyCollection(OneToManyAssociationMetadata $association, object $sourceEntity, PersistentCollection $collection)

Loads a collection of entities in a one-to-many association.

Parameters

OneToManyAssociationMetadata $association The association mapping of the association being loaded.
object $sourceEntity The entity that owns the collection.
PersistentCollection $collection The collection to load/fill.

Return Value

mixed[]

mixed[] getManyToManyCollection(ManyToManyAssociationMetadata $association, object $sourceEntity, int|null $offset = null, int|null $limit = null)

Gets (sliced or full) elements of the given collection.

Parameters

ManyToManyAssociationMetadata $association The association mapping of the association being loaded.
object $sourceEntity The entity that owns the collection.
int|null $offset
int|null $limit Limit number of results.

Return Value

mixed[]

mixed[] loadManyToManyCollection(ManyToManyAssociationMetadata $association, object $sourceEntity, PersistentCollection $collection)

Loads a collection of entities of a many-to-many association.

Parameters

ManyToManyAssociationMetadata $association The association mapping of the association being loaded.
object $sourceEntity The entity that owns the collection.
PersistentCollection $collection The collection to load/fill.

Return Value

mixed[]

EntityHydrator getEntityHydrator()

Return Value

EntityHydrator

bool storeEntityCache($entity, EntityCacheKey $key)

Parameters

$entity
EntityCacheKey $key

Return Value

bool