library/Garp/Model/Db.php
protected function _improvedFetch(Zend_Db_Select $select, $method) {
        if ($method != 'fetchRow' && $method != 'fetchAll') {
            throw new Garp_Model_Exception('\'method\' must be "fetchRow" or "fetchAll".');
        }

        /**
         * Observers are allowed to set $results. This way, behaviors can swoop in
         * and use a different source when fetching records based on certain parameters.
         * For instance, the Cachable behavior might fetch data from the cache
         * instead of the database.
         */
        $results = -1;
        $this->notifyObservers('beforeFetch', array($this, $select, &$results));
        // Results was untouched, fetch a live result.
        if ($results === -1) {
            $results = parent::$method($select);
            $this->notifyObservers('afterFetch', array($this, &$results, $select));
        }
        return $results;
    }
protected function _improvedFetch(Zend_Db_Select $select, $method) {
        if ($method != 'fetchRow' && $method != 'fetchAll') {
            throw new Garp_Model_Exception('\'method\' must be "fetchRow" or "fetchAll".');
        }

        /**
         * Observers are allowed to set $results. This way, behaviors can swoop in
         * and use a different source when fetching records based on certain parameters.
         * For instance, the Cachable behavior might fetch data from the cache
         * instead of the database.
         */
        $results = -1;
        $this->notifyObservers('beforeFetch', array($this, $select, &$results));
        // Results was untouched, fetch a live result.
        if ($results === -1) {
            $results = parent::$method($select);
            $this->notifyObservers('afterFetch', array($this, &$results, $select));
        }
        return $results;
    }
protected function _improvedFetch ( Zend_Db_Select $ select , $ method ) { if ( $ method != 'fetchRow' && $ method != 'fetchAll' ) { throw new Garp_Model_Exception ( '\'method\' must be "fetchRow" or "fetchAll".' ) ; } /**
         * Observers are allowed to set $results. This way, behaviors can swoop in
         * and use a different source when fetching records based on certain parameters.
         * For instance, the Cachable behavior might fetch data from the cache
         * instead of the database.
         */ $ results = - 1 ; $ this -> notifyObservers ( 'beforeFetch' , array ( $ this , $ select , & $ results ) ) ; // Results was untouched, fetch a live result. if ( $ results === - 1 ) { $ results = parent :: $ method ( $ select ) ; $ this -> notifyObservers ( 'afterFetch' , array ( $ this , & $ results , $ select ) ) ; } return $ results ; }
A utility method that extends both fetchRow and fetchAll.

@param Zend_Db_Select $select Select object passed to either parent::fetchRow
or parent::fetchAll
@param String $method The real method, 'fetchRow' or 'fetchAll'
@return Mixed
A utility method that extends both fetchRow and fetchAll .