UNA
|
Public Member Functions | |
__clone () | |
setReadOnlyMode ($b) | |
connect () | |
disconnect () | |
ping () | |
pdoExec ($sQuery) | |
pdoQuery ($sQuery) | |
pdoExceptionHandler ($oException) | |
getOption ($sName) | |
getOne ($oStatement, $aBindings=array(), $iIndex=0) | |
getRow ($oStatement, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC) | |
getColumn ($oStatement, $aBindings=array(), $iFetchColumnNumber=0) | |
getFirstRow ($oStatement, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC) | |
getNextRow ($iFetchType=PDO::FETCH_ASSOC) | |
getAll ($oStatement, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC) | |
fillArray ($oStatement, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC) | |
getAllWithKey ($oStatement, $sFieldKey, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC) | |
getPairs ($oStatement, $sFieldKey, $sFieldValue, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC) | |
getNumRows ($oStatement=null) | |
getAffectedRows ($oStatement=null) | |
lastId () | |
query ($oStatement, $aBindings=array(), $bVerbose=null) | |
res ($oStatement, $aBindings=array(), $bVerbose=null) | |
getServerInfo () | |
getVersion () | |
listTables () | |
getFields ($sTable) | |
fetchField ($oStatement, $iField, $aBindings=array()) | |
isTableExists ($sTable) | |
isFieldExists ($sTable, $sFieldName) | |
isIndexExists ($sTable, $sIndexName) | |
error ($aError) | |
cacheParams ($bForceCacheInvalidate=false, $bForceCacheInvalidateMixed=false) | |
cacheParamsClear ($sCacheName='') | |
isParam ($sKey, $bFromCache=true) | |
addParam ($sName, $sValue, $iKateg, $sDesc, $sType) | |
getParam ($sKey, $bFromCache=true) | |
setParam ($sKey, $mixedValue, $iMixId=0) | |
getParamsMix ($iId) | |
getParamsMixActive ($sType) | |
getParamsMixes ($sType, $mixedPublished=false) | |
setTimezone ($sTimezone) | |
getEncoding () | |
setErrorChecking ($b) | |
getDbCacheObject () | |
genDbCacheKey ($sName) | |
getCache ($sName, $sFunc) | |
setCache ($sName, $mData) | |
fromCache ($sName, $sFunc) | |
cleanCache ($sName) | |
& | fromMemory ($sName, $sFunc) |
cleanMemory ($sName) | |
cleanMemoryAll () | |
escape ($s) | |
implode_escape ($mixed) | |
unescape ($mixed) | |
prepare ($sQuery) | |
prepareAsString ($sQuery) | |
arrayToSQL ($a, $sDiv=',', $sOperator='=', $bWildcardSpaceChars=false) | |
executeSQL ($sPath, $aReplace=array(), $isBreakOnError=true) | |
Static Public Member Functions | |
static | getInstance () |
static | getInstanceWithConf ($aDbConf, &$sError) |
static | getLink () |
Protected Member Functions | |
__construct ($aDbConf=false) | |
balancer () | |
isParamInCache ($sKey) | |
log ($s) | |
executeStatement ($oStatement, $aBindings=array(), $bVerbose=null, &$iErrorCode=null) | |
executeStatementException ($oStatement, $aBindings=array(), $bVerbose=null) | |
executeStatementSilent ($oStatement, $aBindings=array(), $bVerbose=null) | |
errorOutput ($aError) | |
Static Protected Attributes | |
static | $_rLink |
static | $_aDbCacheData |
static | $_aParams |
static | $_sParamsCacheName = 'sys_options' |
static | $_sParamsCacheNameMixed = 'sys_options_mixed_' |
static | $_sParamsCacheNameMix = 'sys_options_mix_' |
static | $_sErrorKey = 'bx_db_error' |
static | $_aErrors |
static | $_bReadOnlyMode = true |
static | $_bMultuServersMode = false |
|
protected |
set database parameters and connect to it
Reimplemented in BxDolCaptchaQuery, BxDolCategoryQuery, BxDolChartQuery, BxDolConnectionQuery, BxDolEditorQuery, BxDolFactoryObjectQuery, BxDolFileHandlerQuery, BxDolFormQuery, BxDolGridQuery, BxDolLogsQuery, BxDolMenuQuery, BxDolMetatagsQuery, BxDolModuleDb, BxDolPageQuery, BxDolPlayerQuery, BxDolRelationQuery, BxDolRssQuery, BxDolSearchExtendedQuery, BxDolStorageQuery, BxDolTranscoderAudioQuery, BxDolTranscoderImageQuery, BxDolTranscoderVideoQuery, BxDolUploaderQuery, and BxDolWikiQuery.
BxDolDb::__clone | ( | ) |
Prevent cloning the instance
Reimplemented in BxDolAccountQuery, BxDolAclQuery, BxDolApiQuery, BxDolAuditQuery, BxDolCronQuery, BxDolLanguagesQuery, BxDolModuleQuery, BxDolPermalinks, BxDolProfileQuery, BxDolStudioOptionsQuery, BxDolStudioPageQuery, BxDolStudioRolesQuery, and BxDolStudioWidgetsQuery.
BxDolDb::arrayToSQL | ( | $a, | |
$sDiv = ',', | |||
$sOperator = '=', | |||
$bWildcardSpaceChars = false ) |
Convert array of key => values to SQL query. Array keys are field names and array values are field values.
$a | array |
$sDiv | fields separator, by default it is ',', another useful value is ' AND ' |
$sOperator | operator for comparision: '=' or 'LIKE' |
$bWildcardSpaceChars | substiture any space and dash characters with single wildcard symbol |
BxDolDb::connect | ( | ) |
connect to database with appointed parameters
BxDolDb::disconnect | ( | ) |
close mysql connection
BxDolDb::escape | ( | $s | ) |
It escapes string to pass to mysql query. Try to use "prepare" function always (
string | $s | string to escape |
BxDolDb::fillArray | ( | $oStatement, | |
$aBindings = array(), | |||
$iFetchType = PDO::FETCH_ASSOC ) |
Executes sql query and returns table of records as result.
BxDolDb::getAffectedRows | ( | $oStatement = null | ) |
returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement.
BxDolDb::getAll | ( | $oStatement, | |
$aBindings = array(), | |||
$iFetchType = PDO::FETCH_ASSOC ) |
execute sql query and return table of records as result
BxDolDb::getAllWithKey | ( | $oStatement, | |
$sFieldKey, | |||
$aBindings = array(), | |||
$iFetchType = PDO::FETCH_ASSOC ) |
execute sql query and return table of records as result
BxDolDb::getColumn | ( | $oStatement, | |
$aBindings = array(), | |||
$iFetchColumnNumber = 0 ) |
execute sql query and return a column as result
BxDolDb::getDbCacheObject | ( | ) |
Cache functions.
BxDolDb::getFirstRow | ( | $oStatement, | |
$aBindings = array(), | |||
$iFetchType = PDO::FETCH_ASSOC ) |
execute sql query and return the first row of result and keep $array type and poiter to all data
|
static |
Get singleton instance of the class
Implements iBxDolSingleton.
Reimplemented in BxDolAccountQuery, BxDolAclQuery, BxDolApiQuery, BxDolAuditQuery, BxDolCronQuery, BxDolEmailTemplatesQuery, BxDolLanguagesQuery, BxDolModuleQuery, BxDolPermalinks, BxDolProfileQuery, BxDolStudioOptionsQuery, BxDolStudioPageQuery, BxDolStudioRolesQuery, and BxDolStudioWidgetsQuery.
BxDolDb::getNextRow | ( | $iFetchType = PDO::FETCH_ASSOC | ) |
return next row of pointed last getFirstRow calling data
BxDolDb::getNumRows | ( | $oStatement = null | ) |
return number of affected rows in current mysql result
NOTE: PDOStatement\rowCount works for SELECT queries in MySQL. So, this method should be rewritten if the other DB engine will be used.
BxDolDb::getOne | ( | $oStatement, | |
$aBindings = array(), | |||
$iIndex = 0 ) |
execute sql query and return one value result
BxDolDb::getOption | ( | $sName | ) |
get mysql option
Reimplemented in BxAdsDb, and BxPaymentDb.
BxDolDb::getPairs | ( | $oStatement, | |
$sFieldKey, | |||
$sFieldValue, | |||
$aBindings = array(), | |||
$iFetchType = PDO::FETCH_ASSOC ) |
execute sql query and return table of records as result
BxDolDb::getRow | ( | $oStatement, | |
$aBindings = array(), | |||
$iFetchType = PDO::FETCH_ASSOC ) |
execute sql query and return one row result
BxDolDb::getServerInfo | ( | ) |
get mysql server info
BxDolDb::getVersion | ( | ) |
get mysql version
BxDolDb::implode_escape | ( | $mixed | ) |
This function is usefull when you need to form array of parameters to pass to IN(...) SQL construction. Example:
$mixed | array or parameters or just one paramter |
BxDolDb::listTables | ( | ) |
get list of tables in database
BxDolDb::pdoExceptionHandler | ( | $oException | ) |
database query exception handler for exceptions appeared out of the try/catch block
BxDolDb::pdoExec | ( | $sQuery | ) |
Can be used to execute queries which shouldn't return data
BxDolDb::pdoQuery | ( | $sQuery | ) |
Executes query and returns PDOStatement object or false
BxDolDb::ping | ( | ) |
check mysql connection
BxDolDb::prepare | ( | $sQuery | ) |
Prepare SQL query before execution if some arguments are need to be passed to it. All parameters marked with question (?) symbol in SQL query are replaced with parameters passed after SQL query parameter. Parameters are properly excaped and surrounded by qutes if needed. Example:
string | $sQuery | SQL query, parameters for replacing are marked with ? symbol |
mixed | $mixed | any number if parameters to replace, number of parameters whould match number of ? symbols in SQL query |
BxDolDb::prepareAsString | ( | $sQuery | ) |
Prepare SQL query before execution if some arguments are need to be passed to it. All parameters marked with question (?) symbol in SQL query are replaced with parameters passed after SQL query parameter. Parameters are properly excaped and surrounded by qutes if needed. Example:
string | $sQuery | SQL query, parameters for replacing are marked with ? symbol |
mixed | $mixed | any number if parameters to replace, number of parameters whould match number of ? symbols in SQL query |
BxDolDb::query | ( | $oStatement, | |
$aBindings = array(), | |||
$bVerbose = null ) |
execute any query return number of rows affected/false
BxDolDb::res | ( | $oStatement, | |
$aBindings = array(), | |||
$bVerbose = null ) |
execute any query
BxDolDb::unescape | ( | $mixed | ) |
|
staticprotected |