interface CacheCollectorInterface in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Cache/CacheCollectorInterface.php \Drupal\Core\Cache\CacheCollectorInterface
Provides a caching wrapper to be used in place of large structures.
This should be extended by systems that need to cache large amounts of data to calling functions. These structures can become very large, so this class is used to allow different strategies to be used for caching internally (lazy loading, building caches over time etc.). This can dramatically reduce the amount of data that needs to be loaded from cache backends on each request, and memory usage from static caches of that same data.
The default implementation is \Drupal\Core\Cache\CacheCollector.
Hierarchy
- interface \Drupal\Core\Cache\CacheCollectorInterface
Expanded class hierarchy of CacheCollectorInterface
All classes that implement CacheCollectorInterface
Related topics
2 files declare their use of CacheCollectorInterface
- AliasWhitelistInterface.php in core/
lib/ Drupal/ Core/ Path/ AliasWhitelistInterface.php - Contains \Drupal\Core\Path\AliasWhitelistInterface.
- LibraryDiscovery.php in core/
lib/ Drupal/ Core/ Asset/ LibraryDiscovery.php - Contains \Drupal\Core\Asset\LibraryDiscovery.
File
- core/
lib/ Drupal/ Core/ Cache/ CacheCollectorInterface.php, line 24 - Contains \Drupal\Core\Cache\CacheCollectorInterface.
Namespace
Drupal\Core\CacheView source
interface CacheCollectorInterface {
/**
* Gets value from the cache.
*
* @param string $key
* Key that identifies the data.
*
* @return mixed
* The corresponding cache data.
*/
public function get($key);
/**
* Sets cache data.
*
* It depends on the specific case and implementation whether this has a
* permanent effect or if it just affects the current request.
*
* @param string $key
* Key that identifies the data.
* @param mixed $value
* The data to be set.
*/
public function set($key, $value);
/**
* Deletes the element.
*
* It depends on the specific case and implementation whether this has a
* permanent effect or if it just affects the current request.
*
* @param string $key
* Key that identifies the data.
*/
public function delete($key);
/**
* Returns whether data exists for this key.
*
* @param string $key
* Key that identifies the data.
*/
public function has($key);
/**
* Resets the local cache.
*
* Does not clear the persistent cache.
*/
public function reset();
/**
* Clears the collected cache entry.
*/
public function clear();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheCollectorInterface:: |
public | function | Clears the collected cache entry. | 1 |
CacheCollectorInterface:: |
public | function | Deletes the element. | 1 |
CacheCollectorInterface:: |
public | function | Gets value from the cache. | 1 |
CacheCollectorInterface:: |
public | function | Returns whether data exists for this key. | 1 |
CacheCollectorInterface:: |
public | function | Resets the local cache. | 1 |
CacheCollectorInterface:: |
public | function | Sets cache data. | 1 |