MemoizedStore
class MemoizedStore extends TaggableStore implements AuthoritativeRawReadable, CanFlushLocks, LockProvider, RawReadable
Properties
| protected array<string, mixed> | $cache | The memoized cache values. |
|
| protected MemoizedTaggedCache> | $taggedCaches | The memoized tagged cache instances. |
Methods
Begin executing a new tags operation.
Determine if the underlying store currently supports tags.
Get the tag mode of the underlying store.
Get the underlying cache store.
Retrieve an item from the cache by key.
Retrieve an item from the cache without unwrapping sentinels.
Retrieve an item without serving it from the memoized layer.
Retrieve multiple items from the cache by key.
Retrieve multiple items from the cache 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.
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.
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.
Forget a memoized value without changing the underlying cache.
Remove all items from the cache.
Remove all memoized items from the tagged caches.
Forget all memoized values without changing the underlying cache.
Get the cache key prefix.
Prefix the given key.
Details
at line 303
TaggedCache
tags(mixed $names)
Begin executing a new tags operation.
at line 323
bool
supportsTags()
Determine if the underlying store currently supports tags.
at line 333
TagMode
getTagMode()
Get the tag mode of the underlying store.
at line 41
__construct(string $name, Repository $repository)
Create a new memoized cache instance.
at line 50
Store
getInnerStore()
Get the underlying cache store.
at line 61
mixed
get(string $key)
Retrieve an item from the cache by key.
Cached null sentinels are unwrapped to null. The raw value is memoized, so later getRaw() calls still see the sentinel.
at line 69
mixed
getRaw(UnitEnum|string $key)
Retrieve an item from the cache without unwrapping sentinels.
at line 86
mixed
memoize(string $key, Closure $callback)
Get a memoized raw value, resolving a miss with the given callback.
at line 100
mixed
getAuthoritativeRaw(UnitEnum|string $key)
Retrieve an item without serving it from the memoized layer.
at line 112
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 123
array
manyRaw(array $keys)
Retrieve multiple items from the cache without unwrapping sentinels.
at line 158
bool
put(string $key, mixed $value, int $seconds)
Store an item in the cache for a given number of seconds.
at line 168
bool
putMany(array $values, int $seconds)
Store multiple items in the cache for a given number of seconds.
at line 183
bool
add(string $key, mixed $value, DateInterval|DateTimeInterface|int|null $ttl = null)
Store an item in the cache if the key does not exist.
The underlying repository decides whether the key exists, because a memoized value may be stale.
at line 193
bool|int
increment(string $key, int $value = 1)
Increment the value of an item in the cache.
at line 203
bool|int
decrement(string $key, int $value = 1)
Decrement the value of an item in the cache.
at line 213
bool
forever(string $key, mixed $value)
Store an item in the cache indefinitely.
at line 225
Lock
lock(string $name, int $seconds = 0, string|null $owner = null)
Get a lock instance.
at line 239
Lock
restoreLock(string $name, string $owner)
Restore a lock instance using the owner identifier.
at line 251
bool
supportsFlushingLocks()
Determine if the store can currently flush locks.
at line 263
bool
flushLocks()
Flush all locks managed by the store.
at line 280
bool
hasSeparateLockStore()
Determine if the lock store is separate from the cache store.
at line 290
bool
touch(string $key, int $seconds)
Adjust the expiration time of a cached item.
at line 347
bool
forget(string $key)
Remove an item from the cache.
at line 357
void
forgetMemoized(string $key)
Forget a memoized value without changing the underlying cache.
at line 365
bool
flush()
Remove all items from the cache.
at line 376
void
flushTagged()
Remove all memoized items from the tagged caches.
at line 386
void
flushMemoized()
Forget all memoized values without changing the underlying cache.
at line 396
string
getPrefix()
Get the cache key prefix.
at line 404
protected string
prefix(string $key)
Prefix the given key.