本文整理汇总了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();
}