FreezableBackendInterface
interface FreezableBackendInterface implements BackendInterface (View source)
A contract for a cache backend which can be frozen.
Methods
Returns the internally used, prefixed entry identifier for the given public entry identifier.
Saves data in the cache.
Checks if a cache entry with the specified identifier exists.
Removes all cache entries matching the specified identifier.
Freezes this cache backend.
Tells if this backend is frozen.
Details
void
setCache(FrontendInterface $cache)
Sets a reference to the cache frontend which uses this backend
string
getPrefixedIdentifier(string $entryIdentifier)
Returns the internally used, prefixed entry identifier for the given public entry identifier.
While Flow applications will mostly refer to the simple entry identifier, it may be necessary to know the actual identifier used by the cache backend in order to share cache entries with other applications. This method allows for retrieving it.
void
set(string $entryIdentifier, string $data, array $tags = [], int $lifetime = null)
Saves data in the cache.
mixed
get(string $entryIdentifier)
Loads data from the cache.
bool
has(string $entryIdentifier)
Checks if a cache entry with the specified identifier exists.
bool
remove(string $entryIdentifier)
Removes all cache entries matching the specified identifier.
Usually this only affects one entry but if - for what reason ever - old entries for the identifier still exist, they are removed as well.
void
flush()
Removes all cache entries of this cache.
void
collectGarbage()
Does garbage collection
void
freeze()
Freezes this cache backend.
All data in a frozen backend remains unchanged and methods which try to add or modify data result in an exception thrown. Possible expiry times of individual cache entries are ignored.
On the positive side, a frozen cache backend is much faster on read access. A frozen backend can only be thawed by calling the flush() method.
bool
isFrozen()
Tells if this backend is frozen.