protected function UseCacheBackendTrait::cacheGet in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Cache/UseCacheBackendTrait.php \Drupal\Core\Cache\UseCacheBackendTrait::cacheGet()
- 9 core/lib/Drupal/Core/Cache/UseCacheBackendTrait.php \Drupal\Core\Cache\UseCacheBackendTrait::cacheGet()
Fetches from the cache backend, respecting the use caches flag.
Parameters
string $cid: The cache ID of the data to retrieve.
Return value
object|false The cache item or FALSE on failure.
See also
\Drupal\Core\Cache\CacheBackendInterface::get()
1 call to UseCacheBackendTrait::cacheGet()
- DefaultPluginManager::getCachedDefinitions in core/
lib/ Drupal/ Core/ Plugin/ DefaultPluginManager.php - Returns the cached plugin definitions of the decorated discovery class.
File
- core/
lib/ Drupal/ Core/ Cache/ UseCacheBackendTrait.php, line 35
Class
- UseCacheBackendTrait
- Provides methods to use a cache backend while respecting a 'use caches' flag.
Namespace
Drupal\Core\CacheCode
protected function cacheGet($cid) {
if ($this->useCaches && $this->cacheBackend) {
return $this->cacheBackend
->get($cid);
}
return FALSE;
}