Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Application_Resource_Multidb Class Reference

Public Member Functions

 init ()
 Initialize the Database Connections (instances of Zend_Db_Table_Abstract)
 
 isDefault ($db)
 Determine if the given db(identifier) is the default db.
 
 getDb ($db=null)
 Retrieve the specified database connection.
 
 getDefaultDb ($justPickOne=true)
 Get the default db connection.
 
- Public Member Functions inherited from Zend_Application_Resource_ResourceAbstract
 __construct ($options=null)
 Create a instance with options.
 
 setOptions (array $options)
 Set options from array.
 
 getOptions ()
 Retrieve resource options.
 
 mergeOptions (array $array1, $array2=null)
 Merge options recursively.
 
 setBootstrap (Zend_Application_Bootstrap_Bootstrapper $bootstrap)
 Set the bootstrap to which the resource is attached.
 
 getBootstrap ()
 Retrieve the bootstrap to which the resource is attached.
 

Protected Member Functions

 _setDefault (Zend_Db_Adapter_Abstract $adapter)
 
 _setDefaultMetadataCache ($cache)
 Set the default metadata cache.
 

Protected Attributes

 $_dbs = array()
 
 $_defaultDb
 
- Protected Attributes inherited from Zend_Application_Resource_ResourceAbstract
 $_bootstrap
 
 $_options = array()
 
 $_skipOptions
 

Member Function Documentation

_setDefault ( Zend_Db_Adapter_Abstract  $adapter)
protected
_setDefaultMetadataCache (   $cache)
protected

Set the default metadata cache.

Parameters
string | Zend_Cache_Core$cache
Returns
Zend_Application_Resource_Multidb
getDb (   $db = null)

Retrieve the specified database connection.

Parameters
null | string | Zend_Db_Adapter_Abstract$dbThe adapter to retrieve. Null to retrieve the default connection
Returns
Zend_Db_Adapter_Abstract
Exceptions
Zend_Application_Resource_Exceptionif the given parameter could not be found
getDefaultDb (   $justPickOne = true)

Get the default db connection.

Parameters
boolean$justPickOneIf true, a random (the first one in the stack) connection is returned if no default was set. If false, null is returned if no default was set.
Returns
null|Zend_Db_Adapter_Abstract
init ( )

Initialize the Database Connections (instances of Zend_Db_Table_Abstract)

Returns
Zend_Application_Resource_Multidb

Implements Zend_Application_Resource_Resource.

isDefault (   $db)

Determine if the given db(identifier) is the default db.

Parameters
string | Zend_Db_Adapter_Abstract$dbThe db to determine whether it's set as default
Returns
boolean True if the given parameter is configured as default. False otherwise

Member Data Documentation

$_dbs = array()
protected
$_defaultDb
protected