equal
deleted
inserted
replaced
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Application |
16 * @package Zend_Application |
17 * @subpackage Resource |
17 * @subpackage Resource |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: Multidb.php 22546 2010-07-10 15:18:12Z freak $ |
20 * @version $Id: Multidb.php 24593 2012-01-05 20:35:02Z matthew $ |
21 */ |
21 */ |
22 |
22 |
23 require_once 'Zend/Application/Resource/ResourceAbstract.php'; |
23 require_once 'Zend/Application/Resource/ResourceAbstract.php'; |
24 |
24 |
25 require_once 'Zend/Db/Table.php'; |
25 require_once 'Zend/Db/Table.php'; |
49 * </pre> |
49 * </pre> |
50 * |
50 * |
51 * @category Zend |
51 * @category Zend |
52 * @package Zend_Application |
52 * @package Zend_Application |
53 * @subpackage Resource |
53 * @subpackage Resource |
54 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
54 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
55 * @license http://framework.zend.com/license/new-bsd New BSD License |
55 * @license http://framework.zend.com/license/new-bsd New BSD License |
56 */ |
56 */ |
57 class Zend_Application_Resource_Multidb extends Zend_Application_Resource_ResourceAbstract |
57 class Zend_Application_Resource_Multidb extends Zend_Application_Resource_ResourceAbstract |
58 { |
58 { |
59 /** |
59 /** |
83 $this->_setDefaultMetadataCache($options['defaultMetadataCache']); |
83 $this->_setDefaultMetadataCache($options['defaultMetadataCache']); |
84 unset($options['defaultMetadataCache']); |
84 unset($options['defaultMetadataCache']); |
85 } |
85 } |
86 |
86 |
87 foreach ($options as $id => $params) { |
87 foreach ($options as $id => $params) { |
88 $adapter = $params['adapter']; |
88 $adapter = $params['adapter']; |
89 $default = (int) ( |
89 $default = (int) ( |
90 isset($params['isDefaultTableAdapter']) && $params['isDefaultTableAdapter'] |
90 isset($params['isDefaultTableAdapter']) && $params['isDefaultTableAdapter'] |
91 || isset($params['default']) && $params['default'] |
91 || isset($params['default']) && $params['default'] |
92 ); |
92 ); |
93 unset( |
93 unset( |
176 $this->_defaultDb = $adapter; |
176 $this->_defaultDb = $adapter; |
177 } |
177 } |
178 |
178 |
179 /** |
179 /** |
180 * Set the default metadata cache |
180 * Set the default metadata cache |
181 * |
181 * |
182 * @param string|Zend_Cache_Core $cache |
182 * @param string|Zend_Cache_Core $cache |
183 * @return Zend_Application_Resource_Multidb |
183 * @return Zend_Application_Resource_Multidb |
184 */ |
184 */ |
185 protected function _setDefaultMetadataCache($cache) |
185 protected function _setDefaultMetadataCache($cache) |
186 { |
186 { |