TaggableBackendInterface
interface TaggableBackendInterface implements BackendInterface (View source)
A contract for a Cache Backend which supports tagging.
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.
Removes all cache entries of this cache which are tagged by the specified tag.
Finds and returns all cache entry identifiers which are tagged by the specified tag.
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
int
flushByTag(string $tag)
Removes all cache entries of this cache which are tagged by the specified tag.
array
findIdentifiersByTag(string $tag)
Finds and returns all cache entry identifiers which are tagged by the specified tag.