You are here

function PMPAPIDrupal::cacheGet in Public Media Platform API Integration 7

Gets a cache value.

Parameters

string $key: The key of the cached value

Return value

The cached data, or FALSE, if $key does not exist, or data has expired

2 calls to PMPAPIDrupal::cacheGet()
PMPAPIDrupal::getDoc in classes/PMPAPIDrupal.php
Gets a doc from the PMP.
PMPAPIDrupal::pull in classes/PMPAPIDrupal.php
Pulls from the PMP.

File

classes/PMPAPIDrupal.php, line 279
Defines a class for PMP creation/transmission and retreival/parsing

Class

PMPAPIDrupal
@file

Code

function cacheGet($key) {
  if ($this->cache) {
    $cache = cache_get($key, $this->cache_bin);
    if (!$cache || REQUEST_TIME > $cache->expire) {
      return FALSE;
    }
    return $cache->data;
  }
}