Zend_Db_Table_Abstract::_setupDatabaseAdapter PHP Method

_setupDatabaseAdapter() protected method

Initialize database adapter.
protected _setupDatabaseAdapter ( ) : void
return void
    protected function _setupDatabaseAdapter()
    {
        if (!$this->_db) {
            $this->_db = self::getDefaultAdapter();
            if (!$this->_db instanceof Zend_Db_Adapter_Abstract) {
                require_once 'Zend/Db/Table/Exception.php';
                throw new Zend_Db_Table_Exception('No adapter found for ' . get_class($this));
            }
        }
    }

Usage Example

Exemplo n.º 1
0
 protected function _setupDatabaseAdapter()
 {
     $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
     if (null !== $bootstrap && null !== ($multidb = $bootstrap->getPluginResource('multidb'))) {
         $this->_db = $multidb->getDb($this->_section);
     } else {
         parent::_setupDatabaseAdapter();
     }
 }
All Usage Examples Of Zend_Db_Table_Abstract::_setupDatabaseAdapter