/Drupal 8

interface CacheBackendInterface

Defines an interface for cache implementations.

All cache implementations have to implement this interface. Drupal\Core\Cache\DatabaseBackend provides the default implementation, which can be consulted as an example.

The cache indentifiers are case sensitive.


Related topics

Cache API
Information about the Drupal Cache API


core/lib/Drupal/Core/Cache/CacheBackendInterface.php, line 16




Name Modifiers Type Description
CacheBackendInterface::CACHE_PERMANENT constant Indicates that the item should never be removed unless explicitly deleted.
CacheBackendInterface::delete public function Deletes an item from the cache.
CacheBackendInterface::deleteAll public function Deletes all cache items in a bin.
CacheBackendInterface::deleteMultiple public function Deletes multiple items from the cache.
CacheBackendInterface::garbageCollection public function Performs garbage collection on a cache bin.
CacheBackendInterface::get public function Returns data from the persistent cache.
CacheBackendInterface::getMultiple public function Returns data from the persistent cache when given an array of cache IDs.
CacheBackendInterface::invalidate public function Marks a cache item as invalid.
CacheBackendInterface::invalidateAll public function Marks all cache items as invalid.
CacheBackendInterface::invalidateMultiple public function Marks cache items as invalid.
CacheBackendInterface::removeBin public function Remove a cache bin.
CacheBackendInterface::set public function Stores data in the persistent cache.
CacheBackendInterface::setMultiple public function Store multiple items in the persistent cache.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.