AbstractFrontend
abstract class AbstractFrontend implements FrontendInterface (View source)
An abstract cache
Properties
protected string | $identifier | Identifies this cache |
|
protected BackendInterface | $backend |
Methods
Initializes this frontend
Returns this cache's identifier
Returns the backend used by this cache
Checks if a cache entry with the specified identifier exists.
Removes the given cache entry from the cache.
Removes all cache entries of this cache.
Removes all cache entries of this cache which are tagged by the specified tag.
Removes all cache entries of this cache which are tagged by any of the specified tags.
Does garbage collection
Checks the validity of an entry identifier. Returns true if it's valid.
Checks the validity of a tag. Returns true if it's valid.
Details
__construct(string $identifier, BackendInterface $backend)
Constructs the cache
void
initializeObject()
Initializes this frontend
The backend is connected with this frontend in initializeObject(), not in __construct(), because the Cache Factory needs an opportunity to register the cache before the backend's setCache() method is called. See CacheFactory::create() for details. A backend (for example the SimpleFileBackend) may rely on the cache already being registered at the CacheManager when its setCache() method is called.
string
getIdentifier()
Returns this cache's identifier
BackendInterface
getBackend()
Returns the backend used by this cache
bool
has(string $entryIdentifier)
Checks if a cache entry with the specified identifier exists.
bool
remove(string $entryIdentifier)
Removes the given cache entry from the cache.
void
flush()
Removes all cache entries of this cache.
int
flushByTag(string $tag)
Removes all cache entries of this cache which are tagged by the specified tag.
int
flushByTags(array $tags)
Removes all cache entries of this cache which are tagged by any of the specified tags.
void
collectGarbage()
Does garbage collection
bool
isValidEntryIdentifier(string $identifier)
Checks the validity of an entry identifier. Returns true if it's valid.
bool
isValidTag(string $tag)
Checks the validity of a tag. Returns true if it's valid.