public function getItem($cache, $key)
    {
        $cache = self::encodeCache($cache);
        $key = self::encodeKey($key);
        $url = "projects/{$this->project_id}/caches/$cache/items/$key";

        $this->setJsonHeaders();
        try {
            $res = $this->apiCall(self::GET, $url);
        } catch (Http_Exception $e) {
            if ($e->getCode() == Http_Exception::NOT_FOUND) {
                return null;
            } else {
                throw $e;
            }
        }
        return self::json_decode($res);
    }
public function getItem($cache, $key)
    {
        $cache = self::encodeCache($cache);
        $key = self::encodeKey($key);
        $url = "projects/{$this->project_id}/caches/$cache/items/$key";

        $this->setJsonHeaders();
        try {
            $res = $this->apiCall(self::GET, $url);
        } catch (Http_Exception $e) {
            if ($e->getCode() == Http_Exception::NOT_FOUND) {
                return null;
            } else {
                throw $e;
            }
        }
        return self::json_decode($res);
    }
public function getItem ( $ cache , $ key ) { $ cache = self :: encodeCache ( $ cache ) ; $ key = self :: encodeKey ( $ key ) ; $ url = "projects/{$this->project_id}/caches/$cache/items/$key" ; $ this -> setJsonHeaders ( ) ; try { $ res = $ this -> apiCall ( self :: GET , $ url ) ; } catch ( Http_Exception $ e ) { if ( $ e -> getCode ( ) == Http_Exception :: NOT_FOUND ) { return null ; } else { throw $ e ; } } return self :: json_decode ( $ res ) ; }
Get item from cache by key

@param string $cache Cache name
@param string $key Cache key
@return mixed|null single item or null
@throws Http_Exception
Get item from cache by key