Exemplo n.º 1
0
 /**
  * Before fetch callback, checks the cache for valid data.
  * @param Array $args
  * @return Void
  */
 public function beforeFetch(&$args)
 {
     $model =& $args[0];
     $select =& $args[1];
     // check if the cache is in use
     if (!$model->getCacheQueries() || !Zend_Registry::get('readFromCache')) {
         return;
     }
     $cacheKey = $this->createCacheKey($model, $select);
     $results = Garp_Cache_Manager::readQueryCache($model, $cacheKey);
     if ($results !== -1) {
         $args[2] = $results;
     } else {
         $this->_openCacheKey = $cacheKey;
     }
 }