class NullBackend in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Cache/NullBackend.php \Drupal\Core\Cache\NullBackend
Defines a stub cache implementation.
The stub implementation is needed when database access is not yet available. Because Drupal's caching system never requires that cached data be present, these stub functions can short-circuit the process and sidestep the need for any persistent storage. Using this cache implementation during normal operations would have a negative impact on performance.
This also can be used for testing purposes.
Hierarchy
- class \Drupal\Core\Cache\NullBackend implements CacheBackendInterface
Expanded class hierarchy of NullBackend
Related topics
3 files declare their use of NullBackend
- CachedStorageTest.php in core/
tests/ Drupal/ Tests/ Core/ Config/ CachedStorageTest.php - Contains \Drupal\Tests\Core\Config\CachedStorageTest.
- NullBackendTest.php in core/
tests/ Drupal/ Tests/ Core/ Cache/ NullBackendTest.php - Contains \Drupal\Tests\Core\Cache\NullBackendTest.
- RecursiveContextualValidatorTest.php in core/
tests/ Drupal/ Tests/ Core/ TypedData/ RecursiveContextualValidatorTest.php - Contains \Drupal\Tests\Core\TypedData\RecursiveContextualValidatorTest.
File
- core/
lib/ Drupal/ Core/ Cache/ NullBackend.php, line 23 - Contains \Drupal\Core\Cache\NullBackend.
Namespace
Drupal\Core\CacheView source
class NullBackend implements CacheBackendInterface {
/**
* Constructs a NullBackend object.
*
* @param string $bin
* The cache bin for which the object is created.
*/
public function __construct($bin) {
}
/**
* {@inheritdoc}
*/
public function get($cid, $allow_invalid = FALSE) {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function getMultiple(&$cids, $allow_invalid = FALSE) {
return array();
}
/**
* {@inheritdoc}
*/
public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = array()) {
}
/**
* {@inheritdoc}
*/
public function setMultiple(array $items = array()) {
}
/**
* {@inheritdoc}
*/
public function delete($cid) {
}
/**
* {@inheritdoc}
*/
public function deleteMultiple(array $cids) {
}
/**
* {@inheritdoc}
*/
public function deleteAll() {
}
/**
* {@inheritdoc}
*/
public function invalidate($cid) {
}
/**
* {@inheritdoc}
*/
public function invalidateMultiple(array $cids) {
}
/**
* {@inheritdoc}
*/
public function invalidateAll() {
}
/**
* {@inheritdoc}
*/
public function garbageCollection() {
}
/**
* {@inheritdoc}
*/
public function removeBin() {
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheBackendInterface:: |
constant | Indicates that the item should never be removed unless explicitly deleted. | ||
NullBackend:: |
public | function |
Deletes an item from the cache. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Deletes all cache items in a bin. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Deletes multiple items from the cache. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Performs garbage collection on a cache bin. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Returns data from the persistent cache. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Returns data from the persistent cache when given an array of cache IDs. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Marks a cache item as invalid. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Marks all cache items as invalid. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Marks cache items as invalid. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Remove a cache bin. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Stores data in the persistent cache. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function |
Store multiple items in the persistent cache. Overrides CacheBackendInterface:: |
|
NullBackend:: |
public | function | Constructs a NullBackend object. |