UseCacheBackendTrait::cacheGet

protected UseCacheBackendTrait::cacheGet($cid)

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()

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\Cache

Code

protected function cacheGet($cid) {
  if ($this->useCaches && $this->cacheBackend) {
    return $this->cacheBackend->get($cid);
  }
  return FALSE;
}
doc_Drupal
2016-10-29 09:51:55
Comments
Leave a Comment

Please login to continue.