MemoizedStore
class MemoizedStore implements CanFlushLocks, LockProvider, RawReadable, Store
Properties
| protected array<string, mixed> | $cache | The memoized cache values. |
Methods
Retrieve an item from the cache by key.
Retrieve an item from the cache by key without unwrapping sentinels.
Retrieve multiple items from the cache by key.
Retrieve multiple items by key without unwrapping sentinels.
Store an item in the cache for a given number of seconds.
Store multiple items in the cache for a given number of seconds.
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.
Restore a lock instance using the owner identifier.
Determine if the store can currently flush locks.
Flush all locks managed by the store.
Determine if the lock store is separate from the cache store.
Adjust the expiration time of a cached item.
Remove an item from the cache.
Remove all items from the cache.
Get the cache key prefix.
Prefix the given key.
Details
at line 29
__construct(string $name, Repository $repository)
Create a new memoized cache instance.
at line 43
mixed
get(string $key)
Retrieve an item from the cache by key.
Store contract method — returns the value with sentinels unwrapped to null, matching the pre-refactor behavior (which returned whatever the inner Repository's get() returned, i.e., unwrapped). Memoizes the raw value so subsequent getRaw() calls see the sentinel.
at line 48
mixed
getRaw(UnitEnum|string $key)
Retrieve an item from the cache by key without unwrapping sentinels.
at line 65
array
many(array $keys)
Retrieve multiple items from the cache by key.
Items not found in the cache will have a null value.
at line 73
array
manyRaw(array $keys)
Retrieve multiple items by key without unwrapping sentinels.
at line 108
bool
put(string $key, mixed $value, int $seconds)
Store an item in the cache for a given number of seconds.
at line 118
bool
putMany(array $values, int $seconds)
Store multiple items in the cache for a given number of seconds.
at line 130
bool|int
increment(string $key, int $value = 1)
Increment the value of an item in the cache.
at line 140
bool|int
decrement(string $key, int $value = 1)
Decrement the value of an item in the cache.
at line 150
bool
forever(string $key, mixed $value)
Store an item in the cache indefinitely.
at line 162
Lock
lock(string $name, int $seconds = 0, string|null $owner = null)
Get a lock instance.
at line 176
Lock
restoreLock(string $name, string $owner)
Restore a lock instance using the owner identifier.
at line 188
bool
supportsFlushingLocks()
Determine if the store can currently flush locks.
at line 200
bool
flushLocks()
Flush all locks managed by the store.
at line 217
bool
hasSeparateLockStore()
Determine if the lock store is separate from the cache store.
at line 227
bool
touch(string $key, int $seconds)
Adjust the expiration time of a cached item.
at line 237
bool
forget(string $key)
Remove an item from the cache.
at line 247
bool
flush()
Remove all items from the cache.
at line 257
string
getPrefix()
Get the cache key prefix.
at line 265
protected string
prefix(string $key)
Prefix the given key.