ConnectionManager Class Reference

Public Member Functions | |
| & | create ($name= '', $config=array()) |
| enumConnectionObjects () | |
| & | getDataSource ($name) |
| & | getInstance () |
| getSourceName (&$source) | |
| loadDataSource ($connName) | |
Public Attributes | |
| $_connectionsEnum = array() | |
| $_dataSources = array() | |
| $config = null | |
Detailed Description
Definition at line 43 of file connection_manager.php.
Member Function Documentation
| & ConnectionManager::create | ( | $ | name = '', |
|
| $ | config = array() | |||
| ) |
Dynamically creates a DataSource object at runtime, with the given name and settings
- Parameters:
-
string $name The DataSource name array $config The DataSource configuration settings
- Returns:
- object A reference to the DataSource object, or null if creation failed
Definition at line 197 of file connection_manager.php.
References $config, and getInstance().
| ConnectionManager::enumConnectionObjects | ( | ) |
Gets a list of class and file names associated with the user-defined DataSource connections
- Returns:
- array An associative array of elements where the key is the connection name (as defined in Connections), and the value is an array with keys 'filename' and 'classname'.
Definition at line 173 of file connection_manager.php.
References $config, and getInstance().
| & ConnectionManager::getDataSource | ( | $ | name | ) |
Gets a reference to a DataSource object
- Parameters:
-
string $name The name of the DataSource, as defined in app/config/connections
- Returns:
- object
Definition at line 95 of file connection_manager.php.
References getInstance().
Referenced by Model::_deleteMulti(), AclNode::_syncTable(), HtmlHelper::checkbox(), Model::del(), AclNode::delete(), Bake::doModel(), Model::escapeField(), Model::execute(), Model::exists(), Model::findAll(), Model::findCount(), Model::findNeighbours(), Model::getAffectedRows(), Model::getColumnTypes(), Model::getNumRows(), AclCLI::initdb(), Model::loadInfo(), Model::query(), DboSource::queryAssociation(), Model::read(), Model::save(), Model::setDataSource(), Model::setSource(), and AclCLI::upgradedb().
| & ConnectionManager::getInstance | ( | ) |
Gets a reference to the ConnectionManger object instance
- Returns:
- object
Definition at line 80 of file connection_manager.php.
Referenced by create(), enumConnectionObjects(), getDataSource(), getSourceName(), and loadDataSource().
| ConnectionManager::getSourceName | ( | &$ | source | ) |
Gets a DataSource name from an object reference
- Parameters:
-
object $source
- Returns:
- string
Definition at line 122 of file connection_manager.php.
References getInstance().
Referenced by DataSource::listSources().
| ConnectionManager::loadDataSource | ( | $ | connName | ) |
Loads the DataSource class for the given connection name
- Parameters:
-
mixed $connName A string name of the connection, as defined in Connections config, or an array containing the file and class name of the object.
- Returns:
- boolean True on success, null on failure or false if the class is already loaded
Definition at line 140 of file connection_manager.php.
References getInstance().
Member Data Documentation
| ConnectionManager::$_connectionsEnum = array() |
Definition at line 65 of file connection_manager.php.
| ConnectionManager::$_dataSources = array() |
Definition at line 58 of file connection_manager.php.
| ConnectionManager::$config = null |
Definition at line 51 of file connection_manager.php.
The documentation for this class was generated from the following file:
- 1.1.x.x/cake/libs/model/connection_manager.php