本文整理匯總了PHP中Zend_Db_Table_Abstract::_setupDatabaseAdapter方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Db_Table_Abstract::_setupDatabaseAdapter方法的具體用法?PHP Zend_Db_Table_Abstract::_setupDatabaseAdapter怎麽用?PHP Zend_Db_Table_Abstract::_setupDatabaseAdapter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Db_Table_Abstract
的用法示例。
在下文中一共展示了Zend_Db_Table_Abstract::_setupDatabaseAdapter方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _setupDatabaseAdapter
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();
}
}
示例2: _setupDatabaseAdapter
protected function _setupDatabaseAdapter()
{
$zl = Zend_Registry::get('Zend_Locale');
if ($zl->getLanguage() == 'id') {
$this->_db = Zend_Registry::get('db1');
} else {
$this->_db = Zend_Registry::get('db3');
}
parent::_setupDatabaseAdapter();
}
示例3: _setupDatabaseAdapter
protected function _setupDatabaseAdapter()
{
$this->_db = Zend_Registry::get('db2');
parent::_setupDatabaseAdapter();
}
示例4: _setupDatabaseAdapter
protected function _setupDatabaseAdapter()
{
$zl = Zend_Registry::get('Zend_Locale');
$this->_db = Zend_Registry::get('db4');
parent::_setupDatabaseAdapter();
}
示例5: _setupDatabaseAdapter
/**
* Initialize database adapter.
*
* @see Zend_Db_Table_Abstract::_setupDatabaseAdapter()
* @return void
*/
protected function _setupDatabaseAdapter()
{
if (!empty(self::$_defaultTableDb)) {
if (null == ($db = $this->getDefaultTableAdapter())) {
foreach (self::getDefaultTableAdapters() as $tableClass => $adapter) {
if (is_subclass_of(get_class($this), $tableClass)) {
$this->_setAdapter($adapter);
break;
}
}
} else {
$this->_setAdapter($db);
}
}
parent::_setupDatabaseAdapter();
}