DefaultCache
in package
implements
Cache
Provides an API for querying/managing the second level cache regions.
Interfaces, Classes, Traits and Enums
- Cache
- Provides an API for querying/managing the second level cache regions.
Table of Contents
- $cacheFactory : CacheFactory
- $defaultQueryCache : QueryCache|null
- $em : EntityManagerInterface
- $queryCaches : array<string|int, QueryCache>
- $uow : UnitOfWork
- __construct() : mixed
- containsCollection() : bool
- Determine whether the cache contains data for the given collection.
- containsEntity() : bool
- Determine whether the cache contains data for the given entity "instance".
- containsQuery() : bool
- Determine whether the cache contains data for the given query.
- evictCollection() : void
- Evicts the cache data for the given identified collection instance.
- evictCollectionRegion() : void
- Evicts all entity data from the given region.
- evictCollectionRegions() : void
- Evict data from all collection regions.
- evictEntity() : void
- Evicts the entity data for a particular entity "instance".
- evictEntityRegion() : void
- Evicts all entity data from the given region.
- evictEntityRegions() : void
- Evict data from all entity regions.
- evictQueryRegion() : mixed
- Evicts all cached query results under the given name, or default query cache if the region name is NULL.
- evictQueryRegions() : void
- Evict data from all query regions.
- getCollectionCacheRegion() : Region|null
- getEntityCacheRegion() : Region|null
- getQueryCache() : QueryCache
- Get query cache by region name or create a new one if none exist.
- buildCollectionCacheKey() : CollectionCacheKey
- buildEntityCacheKey() : EntityCacheKey
- toIdentifierArray() : array<string, mixed>
Properties
$cacheFactory
private
CacheFactory
$cacheFactory
$defaultQueryCache
private
QueryCache|null
$defaultQueryCache
$em
private
EntityManagerInterface
$em
$queryCaches
private
array<string|int, QueryCache>
$queryCaches
= []
$uow
private
UnitOfWork
$uow
Methods
__construct()
public
__construct(EntityManagerInterface $em) : mixed
Parameters
- $em : EntityManagerInterface
Return values
mixed —containsCollection()
Determine whether the cache contains data for the given collection.
public
containsCollection(mixed $className, mixed $association, mixed $ownerIdentifier) : bool
Parameters
- $className : mixed
-
The entity class.
- $association : mixed
-
The field name that represents the association.
- $ownerIdentifier : mixed
-
The identifier of the owning entity.
Return values
bool —true if the underlying cache contains corresponding data; false otherwise.
containsEntity()
Determine whether the cache contains data for the given entity "instance".
public
containsEntity(mixed $className, mixed $identifier) : bool
Parameters
- $className : mixed
-
The entity class.
- $identifier : mixed
-
The entity identifier
Return values
bool —true if the underlying cache contains corresponding data; false otherwise.
containsQuery()
Determine whether the cache contains data for the given query.
public
containsQuery(mixed $regionName) : bool
Parameters
- $regionName : mixed
-
The cache name given to the query.
Return values
bool —true if the underlying cache contains corresponding data; false otherwise.
evictCollection()
Evicts the cache data for the given identified collection instance.
public
evictCollection(mixed $className, mixed $association, mixed $ownerIdentifier) : void
Parameters
- $className : mixed
-
The entity class.
- $association : mixed
-
The field name that represents the association.
- $ownerIdentifier : mixed
-
The identifier of the owning entity.
Return values
void —evictCollectionRegion()
Evicts all entity data from the given region.
public
evictCollectionRegion(mixed $className, mixed $association) : void
Parameters
- $className : mixed
-
The entity class.
- $association : mixed
-
The field name that represents the association.
Return values
void —evictCollectionRegions()
Evict data from all collection regions.
public
evictCollectionRegions() : void
Return values
void —evictEntity()
Evicts the entity data for a particular entity "instance".
public
evictEntity(mixed $className, mixed $identifier) : void
Parameters
- $className : mixed
-
The entity class.
- $identifier : mixed
-
The entity identifier.
Return values
void —evictEntityRegion()
Evicts all entity data from the given region.
public
evictEntityRegion(mixed $className) : void
Parameters
- $className : mixed
-
The entity metadata.
Return values
void —evictEntityRegions()
Evict data from all entity regions.
public
evictEntityRegions() : void
Return values
void —evictQueryRegion()
Evicts all cached query results under the given name, or default query cache if the region name is NULL.
public
evictQueryRegion([mixed $regionName = null ]) : mixed
Parameters
- $regionName : mixed = null
-
The cache name associated to the queries being cached.
Return values
mixed —evictQueryRegions()
Evict data from all query regions.
public
evictQueryRegions() : void
Return values
void —getCollectionCacheRegion()
public
getCollectionCacheRegion(mixed $className, mixed $association) : Region|null
Parameters
- $className : mixed
-
The entity class.
- $association : mixed
-
The field name that represents the association.
Return values
Region|null —getEntityCacheRegion()
public
getEntityCacheRegion(mixed $className) : Region|null
Parameters
- $className : mixed
-
The entity class.
Return values
Region|null —getQueryCache()
Get query cache by region name or create a new one if none exist.
public
getQueryCache([mixed $regionName = null ]) : QueryCache
Parameters
- $regionName : mixed = null
-
Query cache region name, or default query cache if the region name is NULL.
Return values
QueryCache —The Query Cache associated with the region name.
buildCollectionCacheKey()
private
buildCollectionCacheKey(ClassMetadata $metadata, string $association, mixed $ownerIdentifier) : CollectionCacheKey
Parameters
- $metadata : ClassMetadata
-
The entity metadata.
- $association : string
-
The field name that represents the association.
- $ownerIdentifier : mixed
-
The identifier of the owning entity.
Return values
CollectionCacheKey —buildEntityCacheKey()
private
buildEntityCacheKey(ClassMetadata $metadata, mixed $identifier) : EntityCacheKey
Parameters
- $metadata : ClassMetadata
-
The entity metadata.
- $identifier : mixed
-
The entity identifier.
Return values
EntityCacheKey —toIdentifierArray()
private
toIdentifierArray(ClassMetadata $metadata, mixed $identifier) : array<string, mixed>
Parameters
- $metadata : ClassMetadata
-
The entity metadata.
- $identifier : mixed
-
The entity identifier.