kernel
[ class tree: kernel ] [ index: kernel ] [ all elements ]

Class: BitDb

Source Location: /kernel/BitDbBase.php

Class Overview


This class is used for database access and provides a number of functions to help with database portability.


Variables

Methods


Child classes:

BitDbAdodb
This class is used for database access and provides a number of functions to help with database portability.
BitDbPear
This class is used for database access and provides a number of functions to help with database portability.

Class Details

[line 39]
This class is used for database access and provides a number of functions to help with database portability.

Currently used as a base class, this class should be optional to ensure bitweaver continues to function correctly, without a valid database connection.




[ Top ]


Class Variables

$mCacheFlag =

[line 81]

Used to enable AdoDB caching



Tags:

private:  

Type:   mixed


[ Top ]

$mCaseSensitive =  TRUE

[line 76]

Case sensitivity flag used in convertQuery



Tags:

private:  

Type:   mixed


[ Top ]

$mDb =

[line 46]

Used to store the ADODB db object used to access the database.

This is just a pointer to a single global variable used by all classes. This limits database connections to just one per request.




Tags:

private:  

Type:   mixed


[ Top ]

$mDebug =

[line 86]

Used to determine SQL debug output. BitDbAdodb overrides associated methods to use the debugging mechanisms built into ADODB



Tags:

private:  

Type:   mixed


[ Top ]

$mFailed = array()

[line 61]

Used to store failed commands



Tags:

private:  

Type:   mixed


[ Top ]

$mFatalActive =

[line 91]

Determines if fatal query functions should terminate script execution. Defaults to TRUE. Can be deactived for things like expected duplicate inserts



Tags:

private:  

Type:   mixed


[ Top ]

$mName =

[line 51]

Used to identify the ADODB db object



Tags:

private:  

Type:   mixed


[ Top ]

$mNumQueries =  0

[line 66]

Used to store the number of queries executed.



Tags:

private:  

Type:   mixed


[ Top ]

$mQueryTime =  0

[line 71]

Used to store the total query time for this request.



Tags:

private:  

Type:   mixed


[ Top ]

$mType =

[line 56]

Used to store the ADODB db object type



Tags:

private:  

Type:   mixed


[ Top ]



Class Methods


static method getPeriodFormat [line 684]

static void getPeriodFormat( $pPeriod)



Tags:

access:  public


Parameters:

   $pPeriod  

[ Top ]

constructor BitDb [line 96]

BitDb BitDb( )

During initialisation, database parameters are passed to the class.

If these parameters are not valid, class will not be initialised.




[ Top ]

method Affected_Rows [line 1013]

# Affected_Rows( )



Tags:

return:  rows affected by UPDATE/DELETE


Overridden in child classes as:

BitDbAdodb::Affected_Rows()
BitDbPear::Affected_Rows()

[ Top ]

method associateInsert [line 466]

Error associateInsert( insertTable $insertTable, insertData $insertData)

This function will take a set of fields identified by an associative array - $insertData

generate a suitable SQL script and insert the data into the specified table - $insertTable




Tags:

return:  status of the insert


Parameters:

insertTable   $insertTable   Name of the table to be inserted into
insertData   $insertData   Array of data to be inserted. Array keys provide the field names

[ Top ]

method associateUpdate [line 499]

Error associateUpdate( updateTable $updateTable, updateData $updateData, updateId $updateId)

This function will take a set of fields identified by an associative array - $updateData

generate a suitable SQL script update the data into the specified table at the location identified in updateId which holds a name and value entry




Tags:

return:  status of the insert


Parameters:

updateTable   $updateTable   Name of the table to be updated
updateData   $updateData   Array of data to be changed. Array keys provide the field names If an array key contains an '=' it will assumed to already be properly quoted. This allows use of keys like this: `column_name` = `column_name` + ?
updateId   $updateId   Array identifying the record to update. Array key 'name' provide the field name, and 'value' the record key

[ Top ]

method CompleteTrans [line 996]

true CompleteTrans( )

Used together with StartTrans() to end a transaction. Monitors connection for sql errors, and will commit or rollback as appropriate.

autoComplete if true, monitor sql errors and commit and rollback as appropriate, and if set to false force rollback even if no SQL error detected.




Tags:

return:  on commit, false on rollback.


Overridden in child classes as:

BitDbAdodb::CompleteTrans()
Used together with StartTrans() to end a transaction. Monitors connection for sql errors, and will commit or rollback as appropriate.
BitDbPear::CompleteTrans()
Used together with StartTrans() to end a transaction. Monitors connection for sql errors, and will commit or rollback as appropriate.

[ Top ]

method convertBinary [line 893]

the convertBinary( )

Returns the keyword to force a column comparison to be case sensitive

for none case-sensitive databases (eg MySQL)




Tags:

return:  SQL keyword
todo:  only used in gBitSystem and users_lib to compare login names


[ Top ]

method convertQuery [line 759]

the convertQuery( pQuery &$pQuery)

Converts backtick (`) quotes to the appropriate quote for the database.



Tags:

return:  correctly quoted SQL statement
todo:  investigate replacement by AdoDB NameQuote() function
private:  


Overridden in child classes as:

BitDbAdodb::convertQuery()
Converts backtick (`) quotes to the appropriate quote for the database.

Parameters:

pQuery   &$pQuery   the SQL query using backticks (`)

[ Top ]

method convertSortmode [line 794]

the convertSortmode( string $pSortMode)

Converts field sorting abbreviation to SQL - you can pass in a single string or an entire array of sortmodes



Tags:

return:  correctly quoted SQL ORDER statement
access:  public


Parameters:

string   $pSortMode   or array $pSortMode fieldname and sort order string (eg name_asc)

[ Top ]

method convertSortmodeOneItem [line 816]

valid, convertSortmodeOneItem( array $pSortMode)

Converts field sorting abbreviation to SQL and it also allows us to do things like sort by random rows.



Tags:

return:  database-specific sortmode - if sortmode is not valid, NULL is returned
access:  public


Parameters:

array   $pSortMode   If pSortMode is 'random' it will insert the properly named db-specific function to achieve this.

[ Top ]

method convert_binary [line 1090]

void convert_binary( )



Tags:

deprecated:  deprecated since version 2.0.0


[ Top ]

method convert_sortmode [line 1076]

void convert_sortmode( $pSortMode)



Tags:

deprecated:  deprecated since version 2.0.0


Parameters:

   $pSortMode  

[ Top ]

method convert_sortmode_one_item [line 1083]

void convert_sortmode_one_item( $pSortMode)



Tags:

deprecated:  deprecated since version 2.0.0


Parameters:

   $pSortMode  

[ Top ]

method CreateSequence [line 543]

0 CreateSequence( [pSequenceName $seqname = 'adodbseq'], [pStartID $startID = 1])

A database portable Sequence management function.



Tags:

return:  if not supported, otherwise a sequence id
todo:  To be combined with GenID


Overridden in child classes as:

BitDbAdodb::CreateSequence()
A database portable Sequence management function.
BitDbPear::CreateSequence()
A database portable Sequence management function.

Parameters:

pSequenceName   $seqname   Name of the sequence to be used It will be created if it does not already exist
pStartID   $startID   Allows setting the initial value of the sequence

[ Top ]

method createTables [line 255]

true|false createTables( pTables $pTables, [pOptions $pOptions = array()])

Used to create tables - most commonly from package/schema_inc.php files



Tags:

return:  true if created with no errors | false if errors are stored in $this->mFailed
todo:  remove references to BIT_DB_PREFIX, us a member function


Overridden in child classes as:

BitDbAdodb::createTables()
Used to create tables - most commonly from package/schema_inc.php files

Parameters:

pTables   $pTables   an array of tables and creation information in DataDict style
pOptions   $pOptions   an array of options used while creating the tables

[ Top ]

method dbByteDecode [line 962]

a dbByteDecode( pData &$pData)

Used to decode blob data (eg PostgreSQL)



Tags:

return:  string of raw blob data
todo:  had a lot of trouble with AdoDB BlobEncode and BlobDecode the code works but will need work for dbs other than PgSQL


Parameters:

pData   &$pData   escaped blob data

[ Top ]

method dbByteEncode [line 939]

escaped dbByteEncode( pData &$pData)

Used to encode blob data (eg PostgreSQL). Can be called statically



Tags:

return:  blob data
todo:  had a lot of trouble with AdoDB BlobEncode and BlobDecode the code works but will need work for dbs other than PgSQL


Parameters:

pData   &$pData   a string of raw blob data

[ Top ]

method db_byte_decode [line 1111]

void db_byte_decode( &$pData)



Tags:

deprecated:  deprecated since version 2.0.0


Parameters:

   &$pData  

[ Top ]

method db_byte_encode [line 1104]

void db_byte_encode( &$pData)



Tags:

deprecated:  deprecated since version 2.0.0


Parameters:

   &$pData  

[ Top ]

method debug [line 187]

void debug( [pLevel $pLevel = 99])

will activate ADODB like native debugging output



Overridden in child classes as:

BitDbAdodb::debug()
will activate ADODB's native debugging output

Parameters:

pLevel   $pLevel   debugging level - FALSE is off, TRUE is on, 99 is verbose

[ Top ]

method depText [line 1115]

void depText( $pFrom, $pTo)



Parameters:

   $pFrom  
   $pTo  

[ Top ]

method dropTables [line 277]

true dropTables( pTables $pTables)

Used to drop tables



Tags:

return:  | false true if dropped with no errors | false if errors are stored in $this->mFailed
todo:  remove references to BIT_DB_PREFIX, us a member function


Overridden in child classes as:

BitDbAdodb::dropTables()
Used to drop tables

Parameters:

pTables   $pTables   an array of table names to drop

[ Top ]

method Execute [line 341]

void Execute( $pQuery, [ $pNumRows = false], [ $zf_cache = false], [ $pCacheTime = BIT_QUERY_DEFAULT])

ADODB compatibility functions for bitcommerce



Overridden in child classes as:

BitDbPear::Execute()
compatibility function

Parameters:

   $pQuery  
   $pNumRows  
   $zf_cache  
   $pCacheTime  

[ Top ]

method GenID [line 530]

0 GenID( pSequenceName $pSequenceName, [ $pUseDbPrefix = true])

A database portable Sequence management function.



Tags:

return:  if not supported, otherwise a sequence id


Overridden in child classes as:

BitDbAdodb::GenID()
A database portable Sequence management function.
BitDbPear::GenID()
A database portable Sequence management function.

Parameters:

pSequenceName   $pSequenceName   Name of the sequence to be used It will be created if it does not already exist
   $pUseDbPrefix  

[ Top ]

method getArray [line 418]

the getArray( pQuery $pQuery, [pValues $pValues = FALSE], [pForceArray $pForceArray = FALSE], [pFirst2Cols $pFirst2Cols = FALSE], [ $pCacheTime = BIT_QUERY_DEFAULT])

Returns an associative array for the given query.

See AdoDB GetAssoc() function for more detail.




Tags:

return:  associative array, or false if an error occurs


Overridden in child classes as:

BitDbAdodb::getArray()
Returns an associative array for the given query.
BitDbPear::getArray()
Returns an associative array for the given query.

Parameters:

pQuery   $pQuery   the SQL query. Use backticks (`) to quote all table and attribute names for AdoDB to quote appropriately.
pValues   $pValues   an array of values used in a parameterised query
pForceArray   $pForceArray   if set to true, when an array is created for each value
pFirst2Cols   $pFirst2Cols   if set to true, only returns the first two columns
   $pCacheTime  

[ Top ]

method getAssoc [line 431]

the getAssoc( pQuery $pQuery, [pValues $pValues = FALSE], [pForceArray $pForceArray = FALSE], [pFirst2Cols $pFirst2Cols = FALSE], [ $pCacheTime = BIT_QUERY_DEFAULT])

Returns an associative array for the given query.

See AdoDB GetAssoc() function for more detail.




Tags:

return:  associative array, or false if an error occurs


Overridden in child classes as:

BitDbAdodb::getAssoc()
Returns an associative array for the given query.
BitDbPear::getAssoc()
Returns an associative array for the given query.

Parameters:

pQuery   $pQuery   the SQL query. Use backticks (`) to quote all table and attribute names for AdoDB to quote appropriately.
pValues   $pValues   an array of values used in a parameterised query
pForceArray   $pForceArray   if set to true, when an array is created for each value
pFirst2Cols   $pFirst2Cols   if set to true, only returns the first two columns
   $pCacheTime  

[ Top ]

method getCaselessColumn [line 1055]

void getCaselessColumn( $pColumn)

Compatibility function for DBs with case insensitive searches

(like MySQL, see: http://dev.mysql.com/doc/refman/5.1/en/case-sensitivity.html) How to use: AND ".$this->mDb->getCaseLessColumn('lc.title')." = 'page title' The reason all this matters is that huge performane difference between: where title = 'PAGE TITLE' and where UPPER(tittle) = 'PAGE TITTLE' The latter version will not make use of the index on page title (at least for MySQl) while the first vesion will use the index. In a case insensitive search DB (MySQL) both forms of the query will give the same results, the only difference being the preformance. Spiderr suggested this solution and suppled the code below




Parameters:

   $pColumn  

[ Top ]

method getCaseSensitivity [line 208]

true getCaseSensitivity( [ $pSensitivity = TRUE])

Sets the case sensitivity mode which is used in convertQuery



Tags:

return:  if DB connection is valid, false if not


Parameters:

   $pSensitivity  

[ Top ]

method getCol [line 406]

the getCol( pQuery $pQuery, [pValues $pValues = FALSE], [pForceArray $pTrim = FALSE], pFirst2Cols 3)

Executes the SQL and returns all elements of the first column as a 1-dimensional array. The recordset is discarded for you automatically. If an error occurs, false is returned.

See AdoDB GetCol() function for more detail.




Tags:

return:  associative array, or false if an error occurs
todo:  not currently used anywhere


Overridden in child classes as:

BitDbAdodb::getCol()
Executes the SQL and returns all elements of the first column as a 1-dimensional array. The recordset is discarded for you automatically. If an error occurs, FALSE is returned.
BitDbPear::getCol()
Executes the SQL and returns all elements of the first column as a 1-dimensional array. The recordset is discarded for you automatically. If an error occurs, false is returned.

Parameters:

pFirst2Cols   3   if set to true, only returns the first two columns
pQuery   $pQuery   the SQL query. Use backticks (`) to quote all table and attribute names for AdoDB to quote appropriately.
pValues   $pValues   an array of values used in a parameterised query
pForceArray   $pTrim   if set to true, when an array is created for each value

[ Top ]

method getDatabaseVersion [line 1031]

# getDatabaseVersion( )

determine current version of the databse



Tags:

return:  hash including 'description', 'version' full string, 'major', 'minor', and 'revsion'


[ Top ]

method getDebugLevel [line 194]

pLevel getDebugLevel( )

returns the level of query debugging output



Tags:

return:  debugging level - FALSE is off, TRUE is on, 99 is verbose


Overridden in child classes as:

BitDbAdodb::getDebugLevel()
returns the level of query debugging output

[ Top ]

method getOne [line 454]

the getOne( pQuery $pQuery, [pValues $pValues = NULL], [pReportErrors $pNumRows = NULL], [pOffset $pOffset = NULL], [ $pCacheTime = BIT_QUERY_DEFAULT])

Returns a single column value from the database.



Tags:

return:  associative array, or false if an error occurs


Overridden in child classes as:

BitDbAdodb::getOne()
Returns a single column value from the database.
BitDbPear::getOne()
Returns a single column value from the database.

Parameters:

pQuery   $pQuery   the SQL query. Use backticks (`) to quote all table and attribute names for AdoDB to quote appropriately.
pValues   $pValues   an array of values used in a parameterised query
pReportErrors   $pNumRows   report errors to STDOUT
pOffset   $pOffset   the row number to begin returning rows from.
   $pCacheTime  

[ Top ]

method getRow [line 442]

returns getRow( pQuery $pQuery, [pValues $pValues = FALSE], [ $pCacheTime = BIT_QUERY_DEFAULT])

Executes the SQL and returns the first row as an array. The recordset and remaining rows are discarded for you automatically. If an error occurs, false is returned.

See AdoDB GetRow() function for more detail.




Tags:

return:  the first row as an array, or false if an error occurs


Overridden in child classes as:

BitDbAdodb::getRow()
Executes the SQL and returns the first row as an array. The recordset and remaining rows are discarded for you automatically. If an error occurs, FALSE is returned.
BitDbPear::getRow()
Executes the SQL and returns the first row as an array. The recordset and remaining rows are discarded for you automatically. If an error occurs, false is returned.

Parameters:

pQuery   $pQuery   the SQL query. Use backticks (`) to quote all table and attribute names for AdoDB to quote appropriately.
pValues   $pValues   an array of values used in a parameterised query
   $pCacheTime  

[ Top ]

method ifNull [line 556]

a ifNull( pField $pField, pNullRepl $pNullRepl)

A database portable IFNULL function.



Tags:

return:  string that represents the function that checks whether $pField is NULL for the given database, and if NULL, change the value returned to $pNullRepl.


Overridden in child classes as:

BitDbAdodb::ifNull()
A database portable IFNULL function.
BitDbPear::ifNull()
A database portable IFNULL function.

Parameters:

pField   $pField   argument to compare to NULL
pNullRepl   $pNullRepl   the NULL replacement value

[ Top ]

method isAdvancedPostgresEnabled [line 1020]

void isAdvancedPostgresEnabled( )

Check for Postgres specific extensions



[ Top ]

method isCachingActive [line 295]

nothing isCachingActive( pCacheExecute 0)

Function to set ADODB query caching member variable



Parameters:

pCacheExecute   0   flag to enable or disable ADODB query caching

[ Top ]

method isFatalActive [line 167]

true isFatalActive( )

Determines if the database connection is valid



Tags:

return:  if DB connection is valid, false if not


[ Top ]

method isValid [line 160]

true isValid( )

Determines if the database connection is valid



Tags:

return:  if DB connection is valid, false if not


[ Top ]

method ls [line 588]

the ls( pDate $pDate)

Format the timestamp in the format the database accepts.



Tags:

return:  timestamp as a quoted string.
todo:  could be used to later convert all int timestamps into db timestamps. Currently not used anywhere.


Overridden in child classes as:

BitDbAdodb::ls()
Format the timestamp in the format the database accepts.
BitDbPear::ls()
Format the timestamp in the format the database accepts.

Parameters:

pDate   $pDate   a Unix integer timestamp or an ISO format Y-m-d H:i:s

[ Top ]

method MetaColumns [line 376]

array MetaColumns( table $table, [upper $normalize = true], [schema $schema = false])

List columns in a database as an array of ADOFieldObjects.

See top of file for definition of object.




Tags:

return:  of ADOFieldObjects for current table.


Overridden in child classes as:

BitDbAdodb::MetaColumns()
List columns in a database as an array of ADOFieldObjects.

Parameters:

table   $table   table name to query
upper   $normalize   uppercase table name (required by some databases)
schema   $schema   is optional database schema to use - not supported by all databases.

[ Top ]

method MetaIndexes [line 390]

array MetaIndexes( table $table, [primary $primary = false], [owner $owner = false])

List indexes in a database as an array of ADOFieldObjects.

See top of file for definition of object.




Tags:

return:  of ADOFieldObjects for current table.


Overridden in child classes as:

BitDbAdodb::MetaIndexes()
List indexes in a database as an array of ADOFieldObjects.

Parameters:

table   $table   table name to query
primary   $primary   list primary indexes
owner   $owner   list owner of index

[ Top ]

method MetaTables [line 362]

array MetaTables( [ttype $ttype = false], [showSchema $showSchema = false], [mask $mask = false])

Create a list of tables available in the current database



Tags:

return:  of tables for current database.


Overridden in child classes as:

BitDbAdodb::MetaTables()
Create a list of tables available in the current database
BitDbPear::MetaTables()
Create a list of tables available in the current database

Parameters:

ttype   $ttype   can either be 'VIEW' or 'TABLE' or false. If false, both views and tables are returned. "VIEW" returns only views "TABLE" returns only tables
showSchema   $showSchema   returns the schema/user with the table name, eg. USER.TABLE
mask   $mask   is the input mask - only supported by oci8 and postgresql

[ Top ]

method NOW [line 597]

void NOW( )

Return the current timestamp literal relevent to the database type



Tags:

todo:  This needs extending to allow the use of GMT timestamp rather then the current server time


[ Top ]

method OffsetDate [line 748]

New OffsetDate( pDays $pDays, [pColumn $pColumn = NULL])

Calculate the offset of a date for a particular database and generate appropriate SQL. Useful for calculating future/past dates and storing in a database.



Tags:

return:  number of days
todo:  Not currently used - this is database specific and uses TIMESTAMP rather than unix seconds


Overridden in child classes as:

BitDbAdodb::OffsetDate()
Calculate the offset of a date for a particular database and generate appropriate SQL. Useful for calculating future/past dates and storing in a database.
BitDbPear::OffsetDate()
Calculate the offset of a date for a particular database and generate appropriate SQL. Useful for calculating future/past dates and storing in a database.

Parameters:

pDays   $pDays   Number of days to offset by If dayFraction=1.5 means 1.5 days from now, 1.0/24 for 1 hour.
pColumn   $pColumn   Value to be offset If NULL an offset from the current time is supplied

[ Top ]

method postDBConnection [line 132]

void postDBConnection( )

This function contains any post-connection work



Tags:

todo:  investigate if this is the correct way to do it.
todo:  remove the BIT_DB_PREFIX, change to a member variable
todo:  get spiderr to explain the schema line
private:  


[ Top ]

method preDBConnection [line 111]

void preDBConnection( )

This function contains any pre-connection work



Tags:

todo:  investigate if this is the correct way to do it.
private:  


[ Top ]

method qstr [line 304]

quoted qstr( pStr $pStr)

Quotes a string to be sent to the database



Tags:

return:  string using AdoDB->qstr()


Overridden in child classes as:

BitDbAdodb::qstr()
Quotes a string to be sent to the database which is passed to function on to AdoDB->qstr().
BitDbPear::qstr()
Quotes a string to be sent to the database which is passed to function on to AdoDB->qstr().

Parameters:

pStr   $pStr   string to be quotes

[ Top ]

method qtNOW [line 614]

void qtNOW( )

Return the current timestamp literal relevent to the database type



Tags:

todo:  This needs extending to allow the use of GMT timestamp rather then the current server time


[ Top ]

method query [line 334]

an query( pQuery $query, [pValues $values = null], [pNumRows $numrows = BIT_QUERY_DEFAULT], [pOffset $offset = BIT_QUERY_DEFAULT], [ $pCacheTime = BIT_QUERY_DEFAULT])

Queries the database reporting an error if detected

than exiting while printing the error. -rlpowell




Tags:

return:  AdoDB RecordSet object


Overridden in child classes as:

BitDbAdodb::query()
Queries the database reporting an error if detected
BitDbPear::query()
Queries the database reporting an error if detected

Parameters:

pQuery   $query   the SQL query. Use backticks (`) to quote all table and attribute names for AdoDB to quote appropriately.
pValues   $values   an array of values used in a parameterised query
pNumRows   $numrows   the number of rows (LIMIT) to return in this query
pOffset   $offset   the row number to begin returning rows from. Used in conjunction with $pNumRows
   $pCacheTime  

[ Top ]

method queryComplete [line 226]

void queryComplete( )

Used to stop query tracking and output results if in debug mode



Overridden in child classes as:

BitDbPear::queryComplete()

[ Top ]

method queryError [line 320]

an queryError( pQuery $pQuery, pError &$pError, [pValues $pValues = NULL], [pNumRows $pNumRows = -1], [pOffset $pOffset = -1])

Queries the database, returning an error if one occurs, rather

than exiting while printing the error. -rlpowell




Tags:

return:  AdoDB RecordSet object conjunction with $pNumRows
todo:  currently not used anywhere.


Overridden in child classes as:

BitDbAdodb::queryError()
Queries the database, returning an error if one occurs, rather
BitDbPear::queryError()
Queries the database, returning an error if one occurs, rather

Parameters:

pQuery   $pQuery   the SQL query. Use backticks (`) to quote all table and attribute names for AdoDB to quote appropriately.
pError   &$pError   the error string to modify and return
pValues   $pValues   an array of values used in a parameterised query
pNumRows   $pNumRows   the number of rows (LIMIT) to return in this query
pOffset   $pOffset   the row number to begin returning rows from. Used in

[ Top ]

method queryStart [line 180]

void queryStart( )

Used to start query timer if in debug mode



[ Top ]

method random [line 566]

string random( )

A database portable RANDOM() function.

Adodb overrides it anyway with it's $rand property.




Tags:

return:  with RANDOM() function.


Overridden in child classes as:

BitDbAdodb::random()
Returns RANDOM function appropiate for database.

[ Top ]

method RollbackTrans [line 1006]

true/false. RollbackTrans( )

If database does not support transactions, rollbacks always fail, so return false otherwise returns true if the Rollback was successful



Overridden in child classes as:

BitDbAdodb::RollbackTrans()
If database does not support transactions, rollbacks always fail, so return FALSE otherwise returns TRUE if the Rollback was successful
BitDbPear::RollbackTrans()
If database does not support transactions, rollbacks always fail, so return false otherwise returns true if the Rollback was successful

[ Top ]

method setCaching [line 286]

nothing setCaching( [pCacheExecute $pCacheFlag = TRUE])

Function to set ADODB query caching member variable



Parameters:

pCacheExecute   $pCacheFlag   flag to enable or disable ADODB query caching

[ Top ]

method setCaseSensitivity [line 201]

true setCaseSensitivity( [ $pSensitivity = TRUE])

Sets the case sensitivity mode which is used in convertQuery



Tags:

return:  if DB connection is valid, false if not


Parameters:

   $pSensitivity  

[ Top ]

method setFatalActive [line 174]

true setFatalActive( [ $pActive = TRUE])

Determines if the database connection is valid



Tags:

return:  if DB connection is valid, false if not


Parameters:

   $pActive  

[ Top ]

method sqlCast [line 911]

the sqlCast( pVar $pVar, pType $pType)

Used to cast variable types for certain databases (ie SyBase & MSSQL)



Tags:

return:  SQL casting statement


Parameters:

pVar   $pVar   the variable value to cast
pType   $pType   the current variable type

[ Top ]

method SQLDate [line 731]

void SQLDate( $pDateFormat, [ $pBaseDate = false])

Format date column in sql string given an input format that understands Y M D



Overridden in child classes as:

BitDbAdodb::SQLDate()
Format date column in sql string given an input format that understands Y M D
BitDbPear::SQLDate()
Format date column in sql string given an input format that understands Y M D

Parameters:

   $pDateFormat  
   $pBaseDate  

[ Top ]

method SQLForUpdate [line 713]

the SQLForUpdate( pColumn 0)

Return the sql to lock selected rows for updating.

ADODB has no native support for this, see http://phplens.com/lens/lensforum/msgs.php?id=13661&x=1




Tags:

return:  timestamp as a quoted string.
todo:  could be used to later convert all int timestamps into db timestamps. Currently not used anywhere.


Parameters:

pColumn   0   name of an integer, or long integer column

[ Top ]

method SQLIntToTimestamp [line 663]

the SQLIntToTimestamp( pColumn $pColumn)

Return the sql to cast the given column from an long integer to a time stamp.

this is most useful for the many places bitweaver stores time as epoch integers ADODB has no native support for this, see http://phplens.com/lens/lensforum/msgs.php?id=13661&x=1




Tags:

return:  timestamp as a quoted string.
todo:  could be used to later convert all int timestamps into db timestamps. Currently not used anywhere.


Parameters:

pColumn   $pColumn   name of an integer, or long integer column

[ Top ]

method SQLTimestampToInt [line 634]

the SQLTimestampToInt( pColumn $pColumn)

Return the sql to cast the given column from a time stamp to a Unix epoch

this is most useful for the many places bitweaver stores time as epoch integers ADODB has no native support for this, see http://phplens.com/lens/lensforum/msgs.php?id=13661&x=1




Tags:

return:  timestamp as a quoted string.
todo:  could be used to later convert all int timestamps into db timestamps. Currently not used anywhere.


Parameters:

pColumn   $pColumn   name of an integer, or long integer column

[ Top ]

method sql_cast [line 1097]

void sql_cast( $pVar, $pType)



Tags:

deprecated:  deprecated since version 2.0.0


Parameters:

   $pVar  
   $pType  

[ Top ]

method StartTrans [line 984]

void StartTrans( )

Improved method of initiating a transaction. Used together with CompleteTrans().

Advantages include:

a. StartTrans/CompleteTrans is nestable, unlike BeginTrans/CommitTrans/RollbackTrans. Only the outermost block is treated as a transaction.
b. CompleteTrans auto-detects SQL errors, and will rollback on errors, commit otherwise.
c. All BeginTrans/CommitTrans/RollbackTrans inside a StartTrans/CompleteTrans block are disabled, making it backward compatible.




Overridden in child classes as:

BitDbAdodb::StartTrans()
Improved method of initiating a transaction. Used together with CompleteTrans().
BitDbPear::StartTrans()
Improved method of initiating a transaction. Used together with CompleteTrans().

[ Top ]

method tableExists [line 265]

true tableExists( pTable $pTable)

Used to check if tables already exists.



Tags:

return:  if table already exists
todo:  should be used to confirm tables are already created


Overridden in child classes as:

BitDbAdodb::tableExists()
Used to check if tables already exists.

Parameters:

pTable   $pTable   the table name

[ Top ]


Documentation generated on Wed, 29 Jul 2015 13:55:49 +0000 by phpDocumentor 1.5.0-lsces