RedisTaggedCache
extends TaggedCache
in package
Table of Contents
- REFERENCE_KEY_FOREVER = 'forever_ref'
- Forever reference key.
- REFERENCE_KEY_STANDARD = 'standard_ref'
- Standard reference key.
- $default : float|int
- The default number of minutes to store items.
- $events : Dispatcher
- The event dispatcher implementation.
- $macros : array<string|int, mixed>
- The registered string macros.
- $store : Store
- The cache store implementation.
- $tags : TagSet
- The tag set instance.
- __call() : mixed
- Dynamically handle calls to the class.
- __callStatic() : mixed
- Dynamically handle calls to the class.
- __clone() : void
- Clone cache repository instance.
- __construct() : void
- Create a new cache repository instance.
- add() : bool
- Store an item in the cache if the key does not exist.
- clear() : mixed
- {@inheritdoc}
- decrement() : int|bool
- Decrement the value of an item in the cache.
- delete() : mixed
- {@inheritdoc}
- deleteMultiple() : mixed
- {@inheritdoc}
- flush() : void
- Remove all items from the cache.
- forever() : void
- Store an item in the cache indefinitely.
- forget() : bool
- Remove an item from the cache.
- get() : mixed
- Retrieve an item from the cache by key.
- getDefaultCacheTime() : float|int
- Get the default cache time.
- getMultiple() : mixed
- {@inheritdoc}
- getStore() : Store
- Get the cache store implementation.
- has() : bool
- Determine if an item exists in the cache.
- hasMacro() : bool
- Checks if macro is registered.
- increment() : int|bool
- Increment the value of an item in the cache.
- macro() : void
- Register a custom macro.
- many() : array<string|int, mixed>
- Retrieve multiple items from the cache by key.
- mixin() : void
- Mix another object into the class.
- offsetExists() : bool
- Determine if a cached value exists.
- offsetGet() : mixed
- Retrieve an item from the cache by key.
- offsetSet() : void
- Store an item in the cache for the default time.
- offsetUnset() : void
- Remove an item from the cache.
- pull() : mixed
- Retrieve an item from the cache and delete it.
- put() : void
- Store an item in the cache.
- putMany() : void
- Store multiple items in the cache for a given number of minutes.
- remember() : mixed
- Get an item from the cache, or store the default value.
- rememberForever() : mixed
- Get an item from the cache, or store the default value forever.
- sear() : mixed
- Get an item from the cache, or store the default value forever.
- set() : mixed
- {@inheritdoc}
- setDefaultCacheTime() : $this
- Set the default cache time in minutes.
- setEventDispatcher() : void
- Set the event dispatcher instance.
- setMultiple() : mixed
- {@inheritdoc}
- taggedItemKey() : string
- Get a fully qualified key for a tagged item.
- tags() : TaggedCache
- Begin executing a new tags operation if the store supports it.
- availableAt() : int
- Get the "available at" UNIX timestamp.
- currentTime() : int
- Get the current system time as a UNIX timestamp.
- deleteForeverKeys() : void
- Delete all of the items that were stored forever.
- deleteKeysByReference() : void
- Find and delete all of the items that were stored against a reference.
- deleteStandardKeys() : void
- Delete all standard items.
- deleteValues() : void
- Delete item keys that have been stored against a reference.
- event() : void
- Fire an event for this cache instance.
- getMinutes() : float|int|null
- Calculate the number of minutes with the given duration.
- handleManyResult() : mixed
- Handle a result for the "many" method.
- itemKey() : string
- Format the key for a cache item.
- parseDateInterval() : DateTimeInterface|int
- If the given value is an interval, convert it to a DateTime instance.
- pushForeverKeys() : void
- Store forever key references into store.
- pushKeys() : void
- Store a reference to the cache key against the reference key.
- pushStandardKeys() : void
- Store standard key references into store.
- referenceKey() : string
- Get the reference key for the segment.
- secondsUntil() : int
- Get the number of seconds until the given DateTime.
Constants
REFERENCE_KEY_FOREVER
Forever reference key.
public
string
REFERENCE_KEY_FOREVER
= 'forever_ref'
REFERENCE_KEY_STANDARD
Standard reference key.
public
string
REFERENCE_KEY_STANDARD
= 'standard_ref'
Properties
$default
The default number of minutes to store items.
protected
float|int
$default
= 60
$events
The event dispatcher implementation.
protected
Dispatcher
$events
$macros
The registered string macros.
protected
static array<string|int, mixed>
$macros
= []
$store
The cache store implementation.
protected
Store
$store
$tags
The tag set instance.
protected
TagSet
$tags
Methods
__call()
Dynamically handle calls to the class.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
Return values
mixed —__callStatic()
Dynamically handle calls to the class.
public
static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
Return values
mixed —__clone()
Clone cache repository instance.
public
__clone() : void
Return values
void —__construct()
Create a new cache repository instance.
public
__construct(Store $store) : void
Parameters
- $store : Store
Return values
void —add()
Store an item in the cache if the key does not exist.
public
add(string $key, mixed $value, DateTimeInterface|DateInterval|float|int $minutes) : bool
Parameters
- $key : string
- $value : mixed
- $minutes : DateTimeInterface|DateInterval|float|int
Return values
bool —clear()
{@inheritdoc}
public
clear() : mixed
Return values
mixed —decrement()
Decrement the value of an item in the cache.
public
decrement(string $key[, mixed $value = 1 ]) : int|bool
Parameters
- $key : string
- $value : mixed = 1
Return values
int|bool —delete()
{@inheritdoc}
public
delete(mixed $key) : mixed
Parameters
- $key : mixed
Return values
mixed —deleteMultiple()
{@inheritdoc}
public
deleteMultiple(mixed $keys) : mixed
Parameters
- $keys : mixed
Return values
mixed —flush()
Remove all items from the cache.
public
flush() : void
Return values
void —forever()
Store an item in the cache indefinitely.
public
forever(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
Return values
void —forget()
Remove an item from the cache.
public
forget(string $key) : bool
Parameters
- $key : string
Return values
bool —get()
Retrieve an item from the cache by key.
public
get(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
Return values
mixed —getDefaultCacheTime()
Get the default cache time.
public
getDefaultCacheTime() : float|int
Return values
float|int —getMultiple()
{@inheritdoc}
public
getMultiple(mixed $keys[, mixed $default = null ]) : mixed
Parameters
- $keys : mixed
- $default : mixed = null
Return values
mixed —getStore()
Get the cache store implementation.
public
getStore() : Store
Return values
Store —has()
Determine if an item exists in the cache.
public
has(string $key) : bool
Parameters
- $key : string
Return values
bool —hasMacro()
Checks if macro is registered.
public
static hasMacro(string $name) : bool
Parameters
- $name : string
Return values
bool —increment()
Increment the value of an item in the cache.
public
increment(string $key[, mixed $value = 1 ]) : int|bool
Parameters
- $key : string
- $value : mixed = 1
Return values
int|bool —macro()
Register a custom macro.
public
static macro(string $name, object|callable $macro) : void
Parameters
- $name : string
- $macro : object|callable
Return values
void —many()
Retrieve multiple items from the cache by key.
public
many(array<string|int, mixed> $keys) : array<string|int, mixed>
Items not found in the cache will have a null value.
Parameters
- $keys : array<string|int, mixed>
Return values
array<string|int, mixed> —mixin()
Mix another object into the class.
public
static mixin(object $mixin) : void
Parameters
- $mixin : object
Return values
void —offsetExists()
Determine if a cached value exists.
public
offsetExists(string $key) : bool
Parameters
- $key : string
Return values
bool —offsetGet()
Retrieve an item from the cache by key.
public
offsetGet(string $key) : mixed
Parameters
- $key : string
Return values
mixed —offsetSet()
Store an item in the cache for the default time.
public
offsetSet(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
Return values
void —offsetUnset()
Remove an item from the cache.
public
offsetUnset(string $key) : void
Parameters
- $key : string
Return values
void —pull()
Retrieve an item from the cache and delete it.
public
pull(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
Return values
mixed —put()
Store an item in the cache.
public
put(string $key, mixed $value[, DateTime|float|int $minutes = null ]) : void
Parameters
- $key : string
- $value : mixed
- $minutes : DateTime|float|int = null
Return values
void —putMany()
Store multiple items in the cache for a given number of minutes.
public
putMany(array<string|int, mixed> $values, DateTimeInterface|DateInterval|float|int $minutes) : void
Parameters
- $values : array<string|int, mixed>
- $minutes : DateTimeInterface|DateInterval|float|int
Return values
void —remember()
Get an item from the cache, or store the default value.
public
remember(string $key, DateTimeInterface|DateInterval|float|int $minutes, Closure $callback) : mixed
Parameters
- $key : string
- $minutes : DateTimeInterface|DateInterval|float|int
- $callback : Closure
Return values
mixed —rememberForever()
Get an item from the cache, or store the default value forever.
public
rememberForever(string $key, Closure $callback) : mixed
Parameters
- $key : string
- $callback : Closure
Return values
mixed —sear()
Get an item from the cache, or store the default value forever.
public
sear(string $key, Closure $callback) : mixed
Parameters
- $key : string
- $callback : Closure
Return values
mixed —set()
{@inheritdoc}
public
set(mixed $key, mixed $value[, mixed $ttl = null ]) : mixed
Parameters
- $key : mixed
- $value : mixed
- $ttl : mixed = null
Return values
mixed —setDefaultCacheTime()
Set the default cache time in minutes.
public
setDefaultCacheTime(float|int $minutes) : $this
Parameters
- $minutes : float|int
Return values
$this —setEventDispatcher()
Set the event dispatcher instance.
public
setEventDispatcher(Dispatcher $events) : void
Parameters
- $events : Dispatcher
Return values
void —setMultiple()
{@inheritdoc}
public
setMultiple(mixed $values[, mixed $ttl = null ]) : mixed
Parameters
- $values : mixed
- $ttl : mixed = null
Return values
mixed —taggedItemKey()
Get a fully qualified key for a tagged item.
public
taggedItemKey(string $key) : string
Parameters
- $key : string
Return values
string —tags()
Begin executing a new tags operation if the store supports it.
public
tags(array<string|int, mixed>|mixed $names) : TaggedCache
Parameters
- $names : array<string|int, mixed>|mixed
Tags
Return values
TaggedCache —availableAt()
Get the "available at" UNIX timestamp.
protected
availableAt(DateTimeInterface|DateInterval|int $delay) : int
Parameters
- $delay : DateTimeInterface|DateInterval|int
Return values
int —currentTime()
Get the current system time as a UNIX timestamp.
protected
currentTime() : int
Return values
int —deleteForeverKeys()
Delete all of the items that were stored forever.
protected
deleteForeverKeys() : void
Return values
void —deleteKeysByReference()
Find and delete all of the items that were stored against a reference.
protected
deleteKeysByReference(string $reference) : void
Parameters
- $reference : string
Return values
void —deleteStandardKeys()
Delete all standard items.
protected
deleteStandardKeys() : void
Return values
void —deleteValues()
Delete item keys that have been stored against a reference.
protected
deleteValues(string $referenceKey) : void
Parameters
- $referenceKey : string
Return values
void —event()
Fire an event for this cache instance.
protected
event(string $event) : void
Parameters
- $event : string
Return values
void —getMinutes()
Calculate the number of minutes with the given duration.
protected
getMinutes(DateTimeInterface|DateInterval|float|int $duration) : float|int|null
Parameters
- $duration : DateTimeInterface|DateInterval|float|int
Return values
float|int|null —handleManyResult()
Handle a result for the "many" method.
protected
handleManyResult(array<string|int, mixed> $keys, string $key, mixed $value) : mixed
Parameters
- $keys : array<string|int, mixed>
- $key : string
- $value : mixed
Return values
mixed —itemKey()
Format the key for a cache item.
protected
itemKey(string $key) : string
Parameters
- $key : string
Return values
string —parseDateInterval()
If the given value is an interval, convert it to a DateTime instance.
protected
parseDateInterval(DateTimeInterface|DateInterval|int $delay) : DateTimeInterface|int
Parameters
- $delay : DateTimeInterface|DateInterval|int
Return values
DateTimeInterface|int —pushForeverKeys()
Store forever key references into store.
protected
pushForeverKeys(string $namespace, string $key) : void
Parameters
- $namespace : string
- $key : string
Return values
void —pushKeys()
Store a reference to the cache key against the reference key.
protected
pushKeys(string $namespace, string $key, string $reference) : void
Parameters
- $namespace : string
- $key : string
- $reference : string
Return values
void —pushStandardKeys()
Store standard key references into store.
protected
pushStandardKeys(string $namespace, string $key) : void
Parameters
- $namespace : string
- $key : string
Return values
void —referenceKey()
Get the reference key for the segment.
protected
referenceKey(string $segment, string $suffix) : string
Parameters
- $segment : string
- $suffix : string
Return values
string —secondsUntil()
Get the number of seconds until the given DateTime.
protected
secondsUntil(DateTimeInterface|DateInterval|int $delay) : int
Parameters
- $delay : DateTimeInterface|DateInterval|int