TagAwareAdapter
in package
implements
TagAwareAdapterInterface, TagAwareCacheInterface, PruneableInterface, ResettableInterface, LoggerAwareInterface
Uses
ContractsTrait, LoggerAwareTrait, ProxyTrait
Tags
Interfaces, Classes, Traits and Enums
- TagAwareAdapterInterface
- Interface for invalidating cached items using tags.
- TagAwareCacheInterface
- Allows invalidating cached items using tags.
- PruneableInterface
- Interface extends psr-6 and psr-16 caches to allow for pruning (deletion) of all expired cache items.
- ResettableInterface
- Resets a pool's local state.
- LoggerAwareInterface
- Describes a logger-aware instance.
Table of Contents
- TAGS_PREFIX = "\x00tags\x00"
- $logger : LoggerInterface|null
- The logger instance.
- $createCacheItem : mixed
- $deferred : mixed
- $getTagsByKey : mixed
- $knownTagVersions : mixed
- $knownTagVersionsTtl : mixed
- $saveTags : mixed
- $setCacheItemTags : mixed
- $tags : mixed
- __construct() : mixed
- __destruct() : mixed
- __sleep() : array<string|int, mixed>
- __wakeup() : mixed
- clear() : bool
- {@inheritdoc}
- commit() : bool
- {@inheritdoc}
- deleteItem() : bool
- {@inheritdoc}
- deleteItems() : bool
- {@inheritdoc}
- getItem() : mixed
- {@inheritdoc}
- getItems() : mixed
- {@inheritdoc}
- hasItem() : bool
- {@inheritdoc}
- invalidateTags() : bool
- Invalidates cached items using tags.
- save() : bool
- {@inheritdoc}
- saveDeferred() : bool
- {@inheritdoc}
- setLogger() : mixed
- Sets a logger.
- generateItems() : Generator
- getTagVersions() : mixed
Constants
TAGS_PREFIX
public
mixed
TAGS_PREFIX
= "\x00tags\x00"
Properties
$logger
The logger instance.
protected
LoggerInterface|null
$logger
$createCacheItem
private
static mixed
$createCacheItem
$deferred
private
mixed
$deferred
= []
$getTagsByKey
private
static mixed
$getTagsByKey
$knownTagVersions
private
mixed
$knownTagVersions
= []
$knownTagVersionsTtl
private
mixed
$knownTagVersionsTtl
$saveTags
private
static mixed
$saveTags
$setCacheItemTags
private
static mixed
$setCacheItemTags
$tags
private
mixed
$tags
Methods
__construct()
public
__construct(AdapterInterface $itemsPool[, AdapterInterface $tagsPool = null ][, float $knownTagVersionsTtl = 0.15 ]) : mixed
Parameters
- $itemsPool : AdapterInterface
- $tagsPool : AdapterInterface = null
- $knownTagVersionsTtl : float = 0.15
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed> —__wakeup()
public
__wakeup() : mixed
Return values
mixed —clear()
{@inheritdoc}
public
clear([string $prefix = '' ]) : bool
Parameters
- $prefix : string = ''
Return values
bool —commit()
{@inheritdoc}
public
commit() : bool
Return values
bool —deleteItem()
{@inheritdoc}
public
deleteItem(mixed $key) : bool
Parameters
- $key : mixed
Return values
bool —deleteItems()
{@inheritdoc}
public
deleteItems(array<string|int, mixed> $keys) : bool
Parameters
- $keys : array<string|int, mixed>
Return values
bool —getItem()
{@inheritdoc}
public
getItem(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —getItems()
{@inheritdoc}
public
getItems([array<string|int, mixed> $keys = [] ]) : mixed
Parameters
- $keys : array<string|int, mixed> = []
Return values
mixed —hasItem()
{@inheritdoc}
public
hasItem(mixed $key) : bool
Parameters
- $key : mixed
Return values
bool —invalidateTags()
Invalidates cached items using tags.
public
invalidateTags(array<string|int, mixed> $tags) : bool
Parameters
- $tags : array<string|int, mixed>
-
An array of tags to invalidate
Return values
bool —save()
{@inheritdoc}
public
save(CacheItemInterface $item) : bool
Parameters
- $item : CacheItemInterface
Return values
bool —saveDeferred()
{@inheritdoc}
public
saveDeferred(CacheItemInterface $item) : bool
Parameters
- $item : CacheItemInterface
Return values
bool —setLogger()
Sets a logger.
public
setLogger(LoggerInterface $logger) : mixed
Parameters
- $logger : LoggerInterface
Return values
mixed —generateItems()
private
generateItems(iteratable<string|int, mixed> $items, array<string|int, mixed> $tagKeys) : Generator
Parameters
- $items : iteratable<string|int, mixed>
- $tagKeys : array<string|int, mixed>
Return values
Generator —getTagVersions()
private
getTagVersions(array<string|int, mixed> $tagsByKey) : mixed
Parameters
- $tagsByKey : array<string|int, mixed>