Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UseCacheBackendTrait.php

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

8 calls to UseCacheBackendTrait::cacheGet()
DefaultPluginManager::getCachedDefinitions in core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
Returns the cached plugin definitions of the decorated discovery class.
EntityDisplayRepository::getAllDisplayModesByEntityType in core/lib/Drupal/Core/Entity/EntityDisplayRepository.php
Gets the entity display mode info for all entity types.
EntityFieldManager::getBaseFieldDefinitions in core/lib/Drupal/Core/Entity/EntityFieldManager.php
Gets the base field definitions for a content entity type.
EntityFieldManager::getFieldDefinitions in core/lib/Drupal/Core/Entity/EntityFieldManager.php
Gets the field definitions for a specific bundle.
EntityFieldManager::getFieldMap in core/lib/Drupal/Core/Entity/EntityFieldManager.php
Gets a lightweight map of fields across bundles.

... See full list

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal