_fetch() protected method

Support method for fetching rows.
protected _fetch ( Zend_Db_Table_Select $select ) : array
$select Zend_Db_Table_Select query options.
return array An array containing the row results in FETCH_ASSOC mode.
示例#1
0
 protected function _fetch(Zend_Db_Table_Select $select)
 {
     // Global plugins
     $plugins = Zend_Registry::isRegistered(Pro_Resource_DbPlugin::REGISTRY_ALIAS) ? Zend_Registry::get(Pro_Resource_DbPlugin::REGISTRY_ALIAS) : array();
     if (!empty($plugins)) {
         foreach ($plugins as $alias => $className) {
             $this->logger->log("applying DbPlugin \"{$alias}\"", Zend_Log::DEBUG);
             /** @var $plugin Pro_Db_Plugin_PluginAbstract */
             $plugin = new $className();
             $plugin->beforeFetch($this->_name, $select);
         }
     }
     // Local plugins
     if (!empty($this->_plugins)) {
         foreach ($this->_plugins as $plugin) {
             $plugin->beforeFetch($this->_name, $select);
         }
     }
     return parent::_fetch($select);
 }
 protected function _fetch(Zend_Db_Table_Select $select)
 {
     if ($this->_cache) {
         $cache_name = 'fetch_' . $this->_name . '_' . md5($select);
         if (($fetch = $this->_cache->load($cache_name)) === false) {
             $fetch = parent::_fetch($select);
             $this->_cache->save($fetch, $cache_name);
         }
     } else {
         $fetch = parent::_fetch($select);
     }
     return $fetch;
 }