Example #1
0
 /**
  * Static method to return the database connection associated with a given DbObject
  *
  * @param string $className Name of the DbObject to retreive the default connection of
  * @return DbConnection object
  */
 private static function _getConnection($className)
 {
     return DbModule::getConnection(call_user_func(array($className, '_getConnectionName'), $className));
 }
Example #2
0
function db($connectionName)
{
    return DbModule::getConnection($connectionName);
}
Example #3
0
 public function __construct($params)
 {
     $this->db = DbModule::getConnection($params['db_connection']);
     $this->style = $params['style'];
     $this->lifetime = $params['lifetime'];
 }