Documentation

DefaultCache
in package
implements Cache

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

Table of Contents

Interfaces

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

Properties

$cacheFactory  : CacheFactory
$defaultQueryCache  : QueryCache|null
$em  : EntityManagerInterface
$queryCaches  : array<string|int, QueryCache>
$uow  : UnitOfWork

Methods

__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()  : void
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

$queryCaches

private array<string|int, QueryCache> $queryCaches = []
Tags
psalm-var

array<string, QueryCache>

Methods

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.

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.

evictCollectionRegions()

Evict data from all collection regions.

public evictCollectionRegions() : 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.

evictEntityRegion()

Evicts all entity data from the given region.

public evictEntityRegion(mixed $className) : void
Parameters
$className : mixed

The entity metadata.

evictEntityRegions()

Evict data from all entity regions.

public evictEntityRegions() : 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 ]) : void
Parameters
$regionName : mixed = null

The cache name associated to the queries being cached.

evictQueryRegions()

Evict data from all query regions.

public evictQueryRegions() : 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.

toIdentifierArray()

private toIdentifierArray(ClassMetadata $metadata, mixed $identifier) : array<string, mixed>
Parameters
$metadata : ClassMetadata
$identifier : mixed

The entity identifier.

Return values
array<string, mixed>

        
On this page

Search results