Repository
interface Repository implements CacheInterface
Methods
Retrieve an item from the cache by key.
Store an item in the cache.
Remove an item from the cache.
Retrieve multiple items from the cache by key.
Store multiple items in the cache.
Remove multiple items from the cache by key.
Determine if an item exists in the cache.
Retrieve an item from the cache and delete it.
Store an item in the cache.
Store an item in the cache if the key does not exist.
Increment the value of an item in the cache.
Decrement the value of an item in the cache.
Store an item in the cache indefinitely.
Get an item from the cache, or execute the given Closure and store the result.
Get an item from the cache, or execute the given Closure and store the result.
Get an item from the cache, or execute the given Closure and store the result forever.
Get an item from the cache, or execute the given Closure and store the result.
Get an item from the cache, or execute the given Closure and store the result forever.
Get an item from the cache, or execute the given Closure and store the result forever.
Set the expiration of a cached item.
Remove an item from the cache.
Details
at line 21
mixed
get(array|UnitEnum|string $key, mixed $default = null)
Retrieve an item from the cache by key.
When an array is given, return a key-value map. Numeric entries are requested keys, while string-keyed entries use their values as defaults.
at line 26
bool
set(UnitEnum|string $key, mixed $value, DateInterval|DateTimeInterface|int|null $ttl = null)
Store an item in the cache.
at line 31
bool
delete(UnitEnum|string $key)
Remove an item from the cache.
at line 39
iterable
getMultiple(iterable $keys, mixed $default = null)
Retrieve multiple items from the cache by key.
at line 44
bool
setMultiple(iterable $values, DateInterval|DateTimeInterface|int|null $ttl = null)
Store multiple items in the cache.
at line 51
bool
deleteMultiple(iterable $keys)
Remove multiple items from the cache by key.
at line 56
bool
has(array|UnitEnum|string $key)
Determine if an item exists in the cache.
at line 61
mixed
pull(UnitEnum|string $key, mixed $default = null)
Retrieve an item from the cache and delete it.
at line 66
bool
put(array|UnitEnum|string $key, mixed $value, DateInterval|DateTimeInterface|int|null $ttl = null)
Store an item in the cache.
at line 71
bool
add(UnitEnum|string $key, mixed $value, DateInterval|DateTimeInterface|int|null $ttl = null)
Store an item in the cache if the key does not exist.
at line 76
bool|int
increment(UnitEnum|string $key, int $value = 1)
Increment the value of an item in the cache.
at line 81
bool|int
decrement(UnitEnum|string $key, int $value = 1)
Decrement the value of an item in the cache.
at line 86
bool
forever(UnitEnum|string $key, mixed $value)
Store an item in the cache indefinitely.
at line 96
mixed
remember(UnitEnum|string $key, Closure|DateInterval|DateTimeInterface|int|null $ttl, Closure $callback)
Get an item from the cache, or execute the given Closure and store the result.
at line 110
array
rememberWithWarmth(UnitEnum|string $key, Closure|DateInterval|DateTimeInterface|int|null $ttl, Closure $callback)
Get an item from the cache, or execute the given Closure and store the result.
at line 124
mixed
sear(UnitEnum|string $key, Closure $callback)
Get an item from the cache, or execute the given Closure and store the result forever.
at line 134
mixed
rememberForever(UnitEnum|string $key, Closure $callback)
Get an item from the cache, or execute the given Closure and store the result forever.
at line 147
mixed
rememberNullable(UnitEnum|string $key, DateInterval|DateTimeInterface|int|null $ttl, Closure $callback)
Get an item from the cache, or execute the given Closure and store the result.
Unlike remember(), a null return from $callback is stored and returned on subsequent calls rather than triggering re-execution.
at line 160
mixed
searNullable(UnitEnum|string $key, Closure $callback)
Get an item from the cache, or execute the given Closure and store the result forever.
Unlike rememberForever(), a null return from $callback is stored and returned on subsequent calls rather than triggering re-execution.
at line 173
mixed
rememberForeverNullable(UnitEnum|string $key, Closure $callback)
Get an item from the cache, or execute the given Closure and store the result forever.
Unlike rememberForever(), a null return from $callback is stored and returned on subsequent calls rather than triggering re-execution.
at line 178
bool
touch(UnitEnum|string $key, DateInterval|DateTimeInterface|int $ttl)
Set the expiration of a cached item.
at line 183
bool
forget(array|UnitEnum|string $key)
Remove an item from the cache.
at line 188
Store
getStore()
Get the cache store implementation.