array(123), 'user' => array(92)). * * @see \Drupal\Core\Cache\CacheBackendInterface::get() * @see \Drupal\Core\Cache\CacheBackendInterface::getMultiple() */ public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []); /** * Store multiple items in the persistent cache. * * @param array $items * An array of cache items, keyed by cid. In the form: * @code * $items = array( * $cid => array( * // Required, will be automatically serialized if not a string. * 'data' => $data, * // Optional, defaults to CacheBackendInterface::CACHE_PERMANENT. * 'expire' => CacheBackendInterface::CACHE_PERMANENT, * // (optional) The cache tags for this item, see CacheBackendInterface::set(). * 'tags' => array(), * ), * ); * @endcode */ public function setMultiple(array $items); /** * Deletes an item from the cache. * * If the cache item is being deleted because it is no longer "fresh", you may * consider using invalidate() instead. This allows callers to retrieve the * invalid item by calling get() with $allow_invalid set to TRUE. In some cases * an invalid item may be acceptable rather than having to rebuild the cache. * * @param string $cid * The cache ID to delete. * * @see \Drupal\Core\Cache\CacheBackendInterface::invalidate() * @see \Drupal\Core\Cache\CacheBackendInterface::deleteMultiple() * @see \Drupal\Core\Cache\CacheBackendInterface::deleteAll() */ public function delete($cid); /** * Deletes multiple items from the cache. * * If the cache items are being deleted because they are no longer "fresh", * you may consider using invalidateMultiple() instead. This allows callers to * retrieve the invalid items by calling get() with $allow_invalid set to TRUE. * In some cases an invalid item may be acceptable rather than having to * rebuild the cache. * * @param array $cids * An array of cache IDs to delete. * * @see \Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple() * @see \Drupal\Core\Cache\CacheBackendInterface::delete() * @see \Drupal\Core\Cache\CacheBackendInterface::deleteAll() */ public function deleteMultiple(array $cids); /** * Deletes all cache items in a bin. * * @see \Drupal\Core\Cache\CacheBackendInterface::invalidateAll() * @see \Drupal\Core\Cache\CacheBackendInterface::delete() * @see \Drupal\Core\Cache\CacheBackendInterface::deleteMultiple() */ public function deleteAll(); /** * Marks a cache item as invalid. * * Invalid items may be returned in later calls to get(), if the $allow_invalid * argument is TRUE. * * @param string $cid * The cache ID to invalidate. * * @see \Drupal\Core\Cache\CacheBackendInterface::delete() * @see \Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple() * @see \Drupal\Core\Cache\CacheBackendInterface::invalidateAll() */ public function invalidate($cid); /** * Marks cache items as invalid. * * Invalid items may be returned in later calls to get(), if the $allow_invalid * argument is TRUE. * * @param string[] $cids * An array of cache IDs to invalidate. * * @see \Drupal\Core\Cache\CacheBackendInterface::deleteMultiple() * @see \Drupal\Core\Cache\CacheBackendInterface::invalidate() * @see \Drupal\Core\Cache\CacheBackendInterface::invalidateAll() */ public function invalidateMultiple(array $cids); /** * Marks all cache items as invalid. * * Invalid items may be returned in later calls to get(), if the $allow_invalid * argument is TRUE. * * @see \Drupal\Core\Cache\CacheBackendInterface::deleteAll() * @see \Drupal\Core\Cache\CacheBackendInterface::invalidate() * @see \Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple() */ public function invalidateAll(); /** * Performs garbage collection on a cache bin. * * The backend may choose to delete expired or invalidated items. */ public function garbageCollection(); /** * Remove a cache bin. */ public function removeBin(); }