Cheetah
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ChWsbUpgradeDb Class Reference

Public Member Functions

 __construct ()
 
 getRow ($sQuery, $aBindings=[], $iFetchStyle=PDO::FETCH_ASSOC)
 
 getColumn ($sQuery, $aBindings=[])
 
 getOne ($sQuery, $aBindings=[], $iIndex=0)
 
 getFirstRow ($sQuery, $aBindings=[], $iFetchStyle=PDO::FETCH_ASSOC)
 
 getNextRow ()
 
 getNumRows ($oStmt=null)
 
 getAffectedRows ($oStmt=null)
 
 query ($sQuery, $aBindings=[])
 
 res ($sQuery, $aBindings=[], $bReplaying=false)
 
 getAll ($sQuery, $aBindings=[], $iFetchType=PDO::FETCH_ASSOC)
 
 fillArray ($oStmt, $iFetchType=PDO::FETCH_ASSOC)
 
 getAllWithKey ($sQuery, $sFieldKey, $aBindings=[], $iFetchType=PDO::FETCH_ASSOC)
 
 getPairs ($sQuery, $sFieldKey, $sFieldValue, $aBindings=[])
 
 lastId ()
 
 listTables ()
 
 getFields ($sTable)
 
 isFieldExists ($sTable, $sFieldName)
 
 fetchField ($mixedQuery, $iField, $aBindings=[])
 
 isIndexExists ($sTable, $sIndexName)
 
 escape ($sText, $bReal=false)
 
 executeSQL ($sPath, $aReplace=array(), $isBreakOnError=true)
 

Public Attributes

 $port
 
 $socket
 
 $dbname
 
 $user
 
 $password
 

Protected Member Functions

 connect ()
 
 disconnect ()
 

Protected Attributes

 $host
 
 $link
 
 $oCurrentStmt
 
 $iCurrentFetchStyle
 

Static Protected Attributes

static $instance
 

Detailed Description

Definition at line 11 of file ChWsbUpgradeDb.php.

Constructor & Destructor Documentation

◆ __construct()

ChWsbUpgradeDb::__construct ( )

Definition at line 20 of file ChWsbUpgradeDb.php.

Member Function Documentation

◆ connect()

ChWsbUpgradeDb::connect ( )
protected

connect to database with appointed parameters

Definition at line 38 of file ChWsbUpgradeDb.php.

◆ disconnect()

ChWsbUpgradeDb::disconnect ( )
protected

close pdo connection

Definition at line 59 of file ChWsbUpgradeDb.php.

◆ escape()

ChWsbUpgradeDb::escape (   $sText,
  $bReal = false 
)
Parameters
string$sText
bool$bRealreturn the actual quotes value or strip the quotes, PS: Use the pdo bindings for user's sake
Returns
string

Definition at line 440 of file ChWsbUpgradeDb.php.

◆ executeSQL()

ChWsbUpgradeDb::executeSQL (   $sPath,
  $aReplace = array (),
  $isBreakOnError = true 
)

Definition at line 454 of file ChWsbUpgradeDb.php.

◆ fetchField()

ChWsbUpgradeDb::fetchField (   $mixedQuery,
  $iField,
  $aBindings = [] 
)

Definition at line 409 of file ChWsbUpgradeDb.php.

◆ fillArray()

ChWsbUpgradeDb::fillArray (   $oStmt,
  $iFetchType = PDO::FETCH_ASSOC 
)
Parameters
PDOStatement$oStmt
int$iFetchType
Returns
array

Definition at line 288 of file ChWsbUpgradeDb.php.

◆ getAffectedRows()

ChWsbUpgradeDb::getAffectedRows (   $oStmt = null)

execute any query return number of rows affected/false

Parameters
null | PDOStatement$oStmt
Returns
int

Definition at line 202 of file ChWsbUpgradeDb.php.

◆ getAll()

ChWsbUpgradeDb::getAll (   $sQuery,
  $aBindings = [],
  $iFetchType = PDO::FETCH_ASSOC 
)

execute sql query and return table of records as result

Parameters
string$sQuery
array$aBindings
int$iFetchType
Returns
array

Definition at line 267 of file ChWsbUpgradeDb.php.

◆ getAllWithKey()

ChWsbUpgradeDb::getAllWithKey (   $sQuery,
  $sFieldKey,
  $aBindings = [],
  $iFetchType = PDO::FETCH_ASSOC 
)

execute sql query and return table of records as result

Parameters
string$sQuery
string$sFieldKey
array$aBindings
int$iFetchType
Returns
array

Definition at line 311 of file ChWsbUpgradeDb.php.

◆ getColumn()

ChWsbUpgradeDb::getColumn (   $sQuery,
  $aBindings = [] 
)

execute sql query and return a column as result

Parameters
string$sQuery
array$aBindings
Returns
array

Definition at line 92 of file ChWsbUpgradeDb.php.

◆ getFields()

ChWsbUpgradeDb::getFields (   $sTable)

Definition at line 386 of file ChWsbUpgradeDb.php.

◆ getFirstRow()

ChWsbUpgradeDb::getFirstRow (   $sQuery,
  $aBindings = [],
  $iFetchStyle = PDO::FETCH_ASSOC 
)

execute sql query and return the first row of result and keep $array type and poiter to all data

Parameters
string$sQuery
array$aBindings
int$iFetchStyle
Returns
array

Definition at line 137 of file ChWsbUpgradeDb.php.

◆ getNextRow()

ChWsbUpgradeDb::getNextRow ( )

return next row of pointed last getFirstRow calling data

Returns
array

Definition at line 164 of file ChWsbUpgradeDb.php.

◆ getNumRows()

ChWsbUpgradeDb::getNumRows (   $oStmt = null)
Parameters
null | PDOStatement$oStmt
Returns
int

Definition at line 191 of file ChWsbUpgradeDb.php.

◆ getOne()

ChWsbUpgradeDb::getOne (   $sQuery,
  $aBindings = [],
  $iIndex = 0 
)

execute sql query and return one value result

Parameters
string$sQuery
array$aBindings
int$iIndex
Returns
mixed

Definition at line 114 of file ChWsbUpgradeDb.php.

◆ getPairs()

ChWsbUpgradeDb::getPairs (   $sQuery,
  $sFieldKey,
  $sFieldValue,
  $aBindings = [] 
)

execute sql query and return table of records as result

Parameters
string$sQuery
string$sFieldKey
string$sFieldValue
array$aBindings
Returns
array

Definition at line 338 of file ChWsbUpgradeDb.php.

◆ getRow()

ChWsbUpgradeDb::getRow (   $sQuery,
  $aBindings = [],
  $iFetchStyle = PDO::FETCH_ASSOC 
)

execute sql query and return one row result

Parameters
string$sQuery
array$aBindings
int$iFetchStyle
Returns
array

Definition at line 72 of file ChWsbUpgradeDb.php.

◆ isFieldExists()

ChWsbUpgradeDb::isFieldExists (   $sTable,
  $sFieldName 
)

Definition at line 402 of file ChWsbUpgradeDb.php.

◆ isIndexExists()

ChWsbUpgradeDb::isIndexExists (   $sTable,
  $sIndexName 
)

Definition at line 417 of file ChWsbUpgradeDb.php.

◆ lastId()

ChWsbUpgradeDb::lastId ( )

Retuns last insert id

Returns
string

Definition at line 361 of file ChWsbUpgradeDb.php.

◆ listTables()

ChWsbUpgradeDb::listTables ( )

Returns an array of all the table names in the database

Returns
array

Definition at line 371 of file ChWsbUpgradeDb.php.

◆ query()

ChWsbUpgradeDb::query (   $sQuery,
  $aBindings = [] 
)

execute any query return number of rows affected

Parameters
string$sQuery
array$aBindings
Returns
int

Definition at line 222 of file ChWsbUpgradeDb.php.

◆ res()

ChWsbUpgradeDb::res (   $sQuery,
  $aBindings = [],
  $bReplaying = false 
)

execute any query

Parameters
string$sQuery
array$aBindings
bool$bReplaying
Returns
PDOStatement

Definition at line 239 of file ChWsbUpgradeDb.php.

Member Data Documentation

◆ $dbname

ChWsbUpgradeDb::$dbname

Definition at line 13 of file ChWsbUpgradeDb.php.

◆ $host

ChWsbUpgradeDb::$host
protected

Definition at line 13 of file ChWsbUpgradeDb.php.

◆ $iCurrentFetchStyle

ChWsbUpgradeDb::$iCurrentFetchStyle
protected

Definition at line 17 of file ChWsbUpgradeDb.php.

◆ $instance

ChWsbUpgradeDb::$instance
staticprotected

Definition at line 15 of file ChWsbUpgradeDb.php.

◆ $link

ChWsbUpgradeDb::$link
protected

Definition at line 14 of file ChWsbUpgradeDb.php.

◆ $oCurrentStmt

ChWsbUpgradeDb::$oCurrentStmt
protected

Definition at line 16 of file ChWsbUpgradeDb.php.

◆ $password

ChWsbUpgradeDb::$password

Definition at line 13 of file ChWsbUpgradeDb.php.

◆ $port

ChWsbUpgradeDb::$port

Definition at line 13 of file ChWsbUpgradeDb.php.

◆ $socket

ChWsbUpgradeDb::$socket

Definition at line 13 of file ChWsbUpgradeDb.php.

◆ $user

ChWsbUpgradeDb::$user

Definition at line 13 of file ChWsbUpgradeDb.php.


The documentation for this class was generated from the following file: