You are here

public function PersistableCache::get in RESTful 7.2

Gets the memory reference of the cached item.

Parameters

string $key: The key to get.

Return value

mixed The reference to the value.

Overrides PersistableCacheInterface::get

File

src/Util/PersistableCache.php, line 54
Contains \Drupal\restful\Util\PersistableCache.

Class

PersistableCache

Namespace

Drupal\restful\Util

Code

public function &get($key) {
  if (!$this
    ->contains($key)) {

    // Load from the real cache if it's not loaded yet.
    $this
      ->load($key);
  }
  if (!$this
    ->contains($key)) {
    $this->data[$key] = NULL;
  }
  return $this->data[$key];
}