MemoizedStore
class MemoizedStore implements AuthoritativeRawReadable, CanFlushLocks, LockProvider, RawReadable, Store
Properties
| protected array<string, mixed> | $cache | The memoized cache values. |
Methods
Get the underlying cache store.
Retrieve an item from the cache by key.
Retrieve an item from the cache by key without unwrapping sentinels.
Retrieve an item without serving it from the memoized layer.
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 30
__construct(string $name, Repository $repository)
Create a new memoized cache instance.
at line 39
Store
getInnerStore()
Get the underlying cache store.
at line 52
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 57
mixed
getRaw(UnitEnum|string $key)
Retrieve an item from the cache by key without unwrapping sentinels.
at line 72
mixed
getAuthoritativeRaw(UnitEnum|string $key)
Retrieve an item without serving it from the memoized layer.
at line 84
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 92
array
manyRaw(array $keys)
Retrieve multiple items by key without unwrapping sentinels.
at line 127
bool
put(string $key, mixed $value, int $seconds)
Store an item in the cache for a given number of seconds.
at line 137
bool
putMany(array $values, int $seconds)
Store multiple items in the cache for a given number of seconds.
at line 149
bool|int
increment(string $key, int $value = 1)
Increment the value of an item in the cache.
at line 159
bool|int
decrement(string $key, int $value = 1)
Decrement the value of an item in the cache.
at line 169
bool
forever(string $key, mixed $value)
Store an item in the cache indefinitely.
at line 181
Lock
lock(string $name, int $seconds = 0, string|null $owner = null)
Get a lock instance.
at line 195
Lock
restoreLock(string $name, string $owner)
Restore a lock instance using the owner identifier.
at line 207
bool
supportsFlushingLocks()
Determine if the store can currently flush locks.
at line 219
bool
flushLocks()
Flush all locks managed by the store.
at line 236
bool
hasSeparateLockStore()
Determine if the lock store is separate from the cache store.
at line 246
bool
touch(string $key, int $seconds)
Adjust the expiration time of a cached item.
at line 256
bool
forget(string $key)
Remove an item from the cache.
at line 266
bool
flush()
Remove all items from the cache.
at line 276
string
getPrefix()
Get the cache key prefix.
at line 284
protected string
prefix(string $key)
Prefix the given key.