class DefaultCache implements Cache (View source)

Provides an API for querying/managing the second level cache regions.

Methods

__construct(EntityManagerInterface $em)

{@inheritdoc}

Region|null
getEntityCacheRegion(string $className)

No description

Region|null
getCollectionCacheRegion(string $className, string $association)

No description

boolean
containsEntity(string $className, mixed $identifier)

Determine whether the cache contains data for the given entity "instance".

void
evictEntity(string $className, mixed $identifier)

Evicts the entity data for a particular entity "instance".

void
evictEntityRegion(string $className)

Evicts all entity data from the given region.

void
evictEntityRegions()

Evict data from all entity regions.

boolean
containsCollection(string $className, string $association, mixed $ownerIdentifier)

Determine whether the cache contains data for the given collection.

void
evictCollection(string $className, string $association, mixed $ownerIdentifier)

Evicts the cache data for the given identified collection instance.

void
evictCollectionRegion(string $className, string $association)

Evicts all entity data from the given region.

void
evictCollectionRegions()

Evict data from all collection regions.

boolean
containsQuery(string $regionName)

Determine whether the cache contains data for the given query.

evictQueryRegion(string|null $regionName = null)

Evicts all cached query results under the given name, or default query cache if the region name is NULL.

void
evictQueryRegions()

Evict data from all query regions.

getQueryCache(string|null $regionName = null)

Get query cache by region name or create a new one if none exist.

Details

__construct(EntityManagerInterface $em)

{@inheritdoc}

Parameters

EntityManagerInterface $em

Region|null getEntityCacheRegion(string $className)

Parameters

string $className The entity class.

Return Value

Region|null

Region|null getCollectionCacheRegion(string $className, string $association)

Parameters

string $className The entity class.
string $association The field name that represents the association.

Return Value

Region|null

boolean containsEntity(string $className, mixed $identifier)

Determine whether the cache contains data for the given entity "instance".

Parameters

string $className The entity class.
mixed $identifier The entity identifier

Return Value

boolean true if the underlying cache contains corresponding data; false otherwise.

void evictEntity(string $className, mixed $identifier)

Evicts the entity data for a particular entity "instance".

Parameters

string $className The entity class.
mixed $identifier The entity identifier.

Return Value

void

void evictEntityRegion(string $className)

Evicts all entity data from the given region.

Parameters

string $className The entity metadata.

Return Value

void

void evictEntityRegions()

Evict data from all entity regions.

Return Value

void

boolean containsCollection(string $className, string $association, mixed $ownerIdentifier)

Determine whether the cache contains data for the given collection.

Parameters

string $className The entity class.
string $association The field name that represents the association.
mixed $ownerIdentifier The identifier of the owning entity.

Return Value

boolean true if the underlying cache contains corresponding data; false otherwise.

void evictCollection(string $className, string $association, mixed $ownerIdentifier)

Evicts the cache data for the given identified collection instance.

Parameters

string $className The entity class.
string $association The field name that represents the association.
mixed $ownerIdentifier The identifier of the owning entity.

Return Value

void

void evictCollectionRegion(string $className, string $association)

Evicts all entity data from the given region.

Parameters

string $className The entity class.
string $association The field name that represents the association.

Return Value

void

void evictCollectionRegions()

Evict data from all collection regions.

Return Value

void

boolean containsQuery(string $regionName)

Determine whether the cache contains data for the given query.

Parameters

string $regionName The cache name given to the query.

Return Value

boolean true if the underlying cache contains corresponding data; false otherwise.

evictQueryRegion(string|null $regionName = null)

Evicts all cached query results under the given name, or default query cache if the region name is NULL.

Parameters

string|null $regionName The cache name associated to the queries being cached.

void evictQueryRegions()

Evict data from all query regions.

Return Value

void

QueryCache getQueryCache(string|null $regionName = null)

Get query cache by region name or create a new one if none exist.

Parameters

string|null $regionName Query cache region name, or default query cache if the region name is NULL.

Return Value

QueryCache The Query Cache associated with the region name.