abstract class ProxyCacheAdapter implements CacheInterface, ResettableInterface, PruneableInterface (View source)

psr-6 cache proxy for an internal cache, which provides segmentation of cache keys based on current versioned mode. This ensures that cross-stage content cannot cross-pollenate each other.

Note: segmentation can be disabled via 'versionedstate = false' being supplied as a constructor arg.

Based on Symfony\Component\Cache\Simple\TraceableCache

Methods

__construct(CacheInterface $pool)

Create container cache controlling an inner pool cache

array
__sleep()

Do not serialize() $this->pool because it may contain a non-serializable cache.

mixed
get(string $key, $default = null)

{@inheritdoc}

bool
has(string $key)

{@inheritdoc}

bool
delete(string $key)

{@inheritdoc}

bool
set(string $key, mixed $value, $ttl = null)

{@inheritdoc}

bool
setMultiple(iterable $items, $ttl = null)

{@inheritdoc}

iterable
getMultiple(iterable $keys, $default = null)

{@inheritdoc}

bool
clear()

{@inheritdoc}

bool
deleteMultiple(iterable $keys)

{@inheritdoc}

bool
prune()

{@inheritdoc}

reset()

{@inheritdoc}

Details

__construct(CacheInterface $pool)

Create container cache controlling an inner pool cache

Parameters

CacheInterface $pool

array __sleep()

Do not serialize() $this->pool because it may contain a non-serializable cache.

For instance, Symfony\Component\Cache\Simple\FilesystemCache cannot be serialized because in will throw an exception in Symfony\Component\Cache\Traits\FilesystemCommonTrait::__sleep()

Return Value

array

mixed get(string $key, $default = null)

{@inheritdoc}

Parameters

string $key
$default

Return Value

mixed

bool has(string $key)

{@inheritdoc}

Parameters

string $key

Return Value

bool

bool delete(string $key)

{@inheritdoc}

Parameters

string $key

Return Value

bool

bool set(string $key, mixed $value, $ttl = null)

{@inheritdoc}

Parameters

string $key
mixed $value
$ttl

Return Value

bool

bool setMultiple(iterable $items, $ttl = null)

{@inheritdoc}

Parameters

iterable $items
$ttl

Return Value

bool

iterable getMultiple(iterable $keys, $default = null)

{@inheritdoc}

Parameters

iterable $keys
$default

Return Value

iterable

bool clear()

{@inheritdoc}

Return Value

bool

bool deleteMultiple(iterable $keys)

{@inheritdoc}

Parameters

iterable $keys

Return Value

bool

bool prune()

{@inheritdoc}

Return Value

bool

reset()

{@inheritdoc}