Public Member Functions | |
Db (Config $config_) | |
executeQuery ($sql_) | |
Execute a database query. | |
getConnection () | |
Get a creole database Connection. | |
setConfigName ($configName_) | |
Set database config name. | |
getConfigName () | |
Get current config name that is used. | |
pushConfigName ($configName_) | |
Set a new datbase config name, and save the old one on a stack. | |
popConfigName () | |
Set the last pushed config name. | |
Private Attributes | |
$_configName = 'foMaster' | |
The current used database config name. | |
$_configNameStack = array() | |
An array used as a stack with config names. |
Functions to communicate with the database server.
Definition at line 15 of file Db.class.php.
Db::Db | ( | Config $ | config_ | ) |
Db::executeQuery | ( | $ | sql_ | ) |
Execute a database query.
$sql_ | - string - The sql query. |
Definition at line 33 of file Db.class.php.
References getConnection().
00034 { 00035 $conn = $this->getConnection(); 00036 return $conn->executeQuery($sql_); 00037 }
Db::getConfigName | ( | ) |
Get current config name that is used.
Definition at line 67 of file Db.class.php.
Referenced by getConnection().
Db::getConnection | ( | ) |
Get a creole database Connection.
Definition at line 44 of file Db.class.php.
References getConfigName().
Referenced by executeQuery().
00045 { 00046 $dsn = $this->_config->getDBDSN($this->getConfigName()); 00047 00048 return Creole::getConnection($dsn); 00049 }
Db::popConfigName | ( | ) |
Db::pushConfigName | ( | $ | configName_ | ) |
Set a new datbase config name, and save the old one on a stack.
$configName_ | - string - A config name. Ie foMaster |
Definition at line 78 of file Db.class.php.
References setConfigName().
00079 { 00080 array_push($this->_configNameStack, $this->_configName); 00081 $this->setConfigName($configName_); 00082 }
Db::setConfigName | ( | $ | configName_ | ) |
Set database config name.
$configName_ | - string - A config name. Ie foMaster |
Definition at line 57 of file Db.class.php.
Referenced by pushConfigName().
Db::$_configName = 'foMaster' [private] |
Db::$_configNameStack = array() [private] |
An array used as a stack with config names.
Definition at line 103 of file Db.class.php.