classQDatabaseBase
QDatabaseBase Class Reference
Inherits QBaseClass.Inherited by QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.

Public Member Functions
- Connect ()
- Query ($strQuery)
- NonQuery ($strNonQuery)
- GetTables ()
- InsertId ($strTableName=null, $strColumnName=null)
- GetFieldsForTable ($strTableName)
- GetIndexesForTable ($strTableName)
- GetForeignKeysForTable ($strTableName)
- TransactionBegin ()
- TransactionCommit ()
- TransactionRollBack ()
- SqlLimitVariablePrefix ($strLimitInfo)
- SqlLimitVariableSuffix ($strLimitInfo)
- SqlSortByVariable ($strSortByInfo)
- Close ()
- __get ($strName)
- __construct ($intDatabaseIndex, $objConfigArray)
- EnableProfiling ()
- SqlVariable ($mixData, $blnIncludeEquality=false, $blnReverseEquality=false)
- PrepareStatement ($strQuery, $mixParameterArray)
- OutputProfiling ()
Public Attributes
Protected Member Functions
- LogQuery ($strQuery)
Protected Attributes
- $intDatabaseIndex
- $blnEnableProfiling
- $strProfileArray
- $objConfigArray
- $blnConnectedFlag = false
- $strEscapeIdentifierBegin = '"'
- $strEscapeIdentifierEnd = '"'
Detailed Description
Every database adapter must implement the following 5 classes (all which are abstract): * DatabaseBase * DatabaseFieldBase * DatabaseResultBase * DatabaseRowBase * DatabaseExceptionBaseThis Database library also has the following classes already defined, and Database adapters are assumed to use them internally: * DatabaseIndex * DatabaseForeignKey * DatabaseFieldType (which is an abstract class that solely contains constants)
Constructor & Destructor Documentation
| QDatabaseBase::__construct | ( | $ | intDatabaseIndex, | |
| $ | objConfigArray | |||
| ) |
Constructs a Database Adapter based on the database index and the configuration array of properties for this particular adapter Sets up the base-level configuration properties for this database, namely DB Profiling and Database Index
- Parameters:
-
integer $intDatabaseIndex string[] $objConfigArray configuration array as passed in to the constructor by QApplicationBase::InitializeDatabaseConnections();
- Returns:
- void
References $intDatabaseIndex, $objConfigArray, QType::Boolean, and QType::Cast().
Member Function Documentation
| QDatabaseBase::__get | ( | $ | strName | ) |
Override method to perform a property "Get" This will get the value of $strName All inhereted objects that call __get() should always fall through to calling parent::__get() in a try/catch statement catching for CallerExceptions.
- Parameters:
-
string $strName Name of the property to get
- Returns:
- mixed the returned property
Reimplemented from QBaseClass.
Reimplemented in QMySqlDatabase, QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
References QCallerException::IncrementOffset().
| QDatabaseBase::Close | ( | ) | [abstract] |
Reimplemented in QMySqlDatabase, QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::Connect | ( | ) | [abstract] |
Reimplemented in QMySqlDatabase, QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::EnableProfiling | ( | ) |
Allows for the enabling of DB profiling while in middle of the script
- Returns:
- void
| QDatabaseBase::GetFieldsForTable | ( | $ | strTableName | ) | [abstract] |
Reimplemented in QMySqlDatabase, QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::GetForeignKeysForTable | ( | $ | strTableName | ) | [abstract] |
Reimplemented in QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::GetIndexesForTable | ( | $ | strTableName | ) | [abstract] |
Reimplemented in QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::GetTables | ( | ) | [abstract] |
Reimplemented in QMySqli5Database, QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::InsertId | ( | $ | strTableName = null, |
|
| $ | strColumnName = null | |||
| ) | [abstract] |
Reimplemented in QMySqlDatabase, QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::LogQuery | ( | $ | strQuery | ) | [protected] |
If EnableProfiling is on, then log the query to the profile array
- Parameters:
-
string $strQuery
- Returns:
- void
Referenced by QMySqli5Database::MultiQuery(), QSqlServerDatabase::NonQuery(), QPostgreSqlDatabase::NonQuery(), QMySqliDatabase::NonQuery(), QMySqlDatabase::NonQuery(), QSqlServerDatabase::Query(), QPostgreSqlDatabase::Query(), QMySqliDatabase::Query(), QMySqli5Database::Query(), and QMySqlDatabase::Query().
| QDatabaseBase::NonQuery | ( | $ | strNonQuery | ) | [abstract] |
Reimplemented in QMySqlDatabase, QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::OutputProfiling | ( | ) |
Displays the OutputProfiling results, plus a link which will popup the details of the profiling.
- Returns:
- void
References _p().
| QDatabaseBase::PrepareStatement | ( | $ | strQuery, | |
| $ | mixParameterArray | |||
| ) |
References QQNamedValue::DelimiterCode, and SqlVariable().
| QDatabaseBase::Query | ( | $ | strQuery | ) | [abstract] |
Reimplemented in QMySqlDatabase, QMySqli5Database, QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::SqlLimitVariablePrefix | ( | $ | strLimitInfo | ) | [abstract] |
Reimplemented in QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::SqlLimitVariableSuffix | ( | $ | strLimitInfo | ) | [abstract] |
Reimplemented in QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::SqlSortByVariable | ( | $ | strSortByInfo | ) | [abstract] |
Reimplemented in QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::SqlVariable | ( | $ | mixData, | |
| $ | blnIncludeEquality = false, |
|||
| $ | blnReverseEquality = false | |||
| ) |
Properly escapes $mixData to be used as a SQL query parameter. If IncludeEquality is set (usually not), then include an equality operator. So for most data, it would just be "=". But, for example, if $mixData is NULL, then most RDBMS's require the use of "IS".
- Parameters:
-
mixed $mixData boolean $blnIncludeEquality whether or not to include an equality operator boolean $blnReverseEquality whether the included equality operator should be a "NOT EQUAL", e.g. "!="
- Returns:
- string the properly formatted SQL variable
Reimplemented in QPostgreSqlDatabase.
References QDateTime::FormatIso.
Referenced by PrepareStatement().
| QDatabaseBase::TransactionBegin | ( | ) | [abstract] |
Reimplemented in QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::TransactionCommit | ( | ) | [abstract] |
Reimplemented in QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
| QDatabaseBase::TransactionRollBack | ( | ) | [abstract] |
Member Data Documentation
QDatabaseBase::$blnConnectedFlag = false [protected] |
QDatabaseBase::$blnEnableProfiling [protected] |
QDatabaseBase::$intDatabaseIndex [protected] |
Referenced by __construct().
QDatabaseBase::$objConfigArray [protected] |
Referenced by __construct().
QDatabaseBase::$strEscapeIdentifierBegin = '"' [protected] |
Reimplemented in QMySqliDatabase, and QSqlServerDatabase.
QDatabaseBase::$strEscapeIdentifierEnd = '"' [protected] |
Reimplemented in QMySqliDatabase, and QSqlServerDatabase.
QDatabaseBase::$strProfileArray [protected] |
| const QDatabaseBase::Adapter = 'Generic Database Adapter (Abstract)' |
Reimplemented in QMySqlDatabase, QMySqli5Database, QMySqliDatabase, QPostgreSqlDatabase, and QSqlServerDatabase.
The documentation for this class was generated from the following file:
- qcodo/_core/framework/QDatabaseBase.class.php
