Horde_Kolab_Storage_Cache_Data::getQuery PHP Method

getQuery() public method

Returns query information.
public getQuery ( string $key ) : mixed
$key string The query key.
return mixed The query data.
    public function getQuery($key)
    {
        if ($this->hasQuery($key)) {
            return $this->_data[self::QUERIES][$key];
        } else {
            throw new Horde_Kolab_Storage_Exception(sprintf('Missing query cache data (Key: %s). Synchronize first!', $key));
        }
    }

Usage Example

Example #1
0
 /**
  * Ensure we have the query data.
  *
  * @return NULL
  */
 private function _init()
 {
     if ($this->_mapping !== null) {
         return;
     }
     if ($this->_data_cache->hasQuery(self::PREFS)) {
         $this->_mapping = $this->_data_cache->getQuery(self::PREFS);
     } else {
         $this->synchronize();
     }
 }