Defines a memory cache implementation that counts set and get calls.
This can be used to mock a cache backend where one needs to know how many times a cache entry was set or requested.
@todo On the longrun this backend should be replaced by phpunit mock objects.
Hierarchy
- class \Drupal\Core\Cache\MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterface
- class \Drupal\Core\Cache\MemoryCounterBackend
File
- core/lib/Drupal/Core/Cache/MemoryCounterBackend.php, line 13
Namespace
Drupal\Core\Cache
Members
Name | Modifiers | Type | Description |
---|---|---|---|
CacheBackendInterface::CACHE_PERMANENT | constant | Indicates that the item should never be removed unless explicitly deleted. | |
MemoryBackend::$cache | protected | property | Array to store cache objects. |
MemoryBackend::deleteAll | public | function | Deletes all cache items in a bin. Overrides CacheBackendInterface::deleteAll |
MemoryBackend::deleteMultiple | public | function | Deletes multiple items from the cache. Overrides CacheBackendInterface::deleteMultiple |
MemoryBackend::garbageCollection | public | function | Performs garbage collection on a cache bin. Overrides CacheBackendInterface::garbageCollection |
MemoryBackend::getMultiple | public | function | Returns data from the persistent cache when given an array of cache IDs. Overrides CacheBackendInterface::getMultiple |
MemoryBackend::getRequestTime | protected | function | Wrapper method for REQUEST_TIME constant. |
MemoryBackend::invalidate | public | function | Marks a cache item as invalid. Overrides CacheBackendInterface::invalidate |
MemoryBackend::invalidateAll | public | function | Marks all cache items as invalid. Overrides CacheBackendInterface::invalidateAll |
MemoryBackend::invalidateMultiple | public | function | Marks cache items as invalid. Overrides CacheBackendInterface::invalidateMultiple |
MemoryBackend::invalidateTags | public | function | Marks cache items with any of the specified tags as invalid. Overrides CacheTagsInvalidatorInterface::invalidateTags |
MemoryBackend::prepareItem | protected | function | Prepares a cached item. |
MemoryBackend::removeBin | public | function | Remove a cache bin. Overrides CacheBackendInterface::removeBin |
MemoryBackend::reset | public | function | Reset statically cached variables. |
MemoryBackend::setMultiple | public | function | Store multiple items in the persistent cache. Overrides CacheBackendInterface::setMultiple |
MemoryBackend::__construct | public | function | Constructs a MemoryBackend object. |
MemoryBackend::__sleep | public | function | Prevents data stored in memory backends from being serialized. |
MemoryCounterBackend::$counter | protected | property | Stores a list of cache cid calls keyed by function name. |
MemoryCounterBackend::delete | public | function | Deletes an item from the cache. Overrides MemoryBackend::delete |
MemoryCounterBackend::get | public | function | Returns data from the persistent cache. Overrides MemoryBackend::get |
MemoryCounterBackend::getCounter | public | function | Returns the call counter for the get, set and delete methods. |
MemoryCounterBackend::increaseCounter | protected | function | Increase the counter for a function with a certain cid. |
MemoryCounterBackend::resetCounter | public | function | Resets the call counter. |
MemoryCounterBackend::set | public | function | Stores data in the persistent cache. Overrides MemoryBackend::set |
Please login to continue.