library/Garp/Model/Behavior/Cachable.php
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;
        }
    }
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;
        }
    }
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 ; } }
Before fetch callback, checks the cache for valid data.
@param Array $args
@return Void
Before fetch callback checks the cache for valid data .