Andrew's Web Libraries (AWL) 0.64
Loading...
Searching...
No Matches
AwlDatabase Class Reference
Inheritance diagram for AwlDatabase:
Collaboration diagram for AwlDatabase:

Public Member Functions

 prepare ( $statement, $driver_options=array())
 query ( $statement)
 Begin ()
 Commit ()
 Rollback ()
 TransactionState ()
 PrepareTranslated ( $statement, $driver_options=array())
 TranslateAll ( $onoff_boolean)
 ErrorInfo ()

Protected Attributes

 $txnstate = 0
 $translate_all = false

Detailed Description

Definition at line 58 of file AwlDatabase.php.

Member Function Documentation

◆ Begin()

AwlDatabase::Begin ( )

Begin a transaction.

Definition at line 101 of file AwlDatabase.php.

◆ Commit()

AwlDatabase::Commit ( )

Complete a transaction.

Definition at line 116 of file AwlDatabase.php.

◆ ErrorInfo()

AwlDatabase::ErrorInfo ( )

Definition at line 173 of file AwlDatabase.php.

◆ prepare()

AwlDatabase::prepare ( $statement,
$driver_options = array() )

#- Returns a PDOStatement object created using this database, the supplied SQL string, and any parameters given.

Parameters
string$sql_query_stringThe SQL string containing optional variable replacements
array$driver_optionsPDO driver options to the prepare statement, commonly to do with cursors

Definition at line 80 of file AwlDatabase.php.

◆ PrepareTranslated()

AwlDatabase::PrepareTranslated ( $statement,
$driver_options = array() )

Operates identically to AwlDatabase::Prepare, except that $this->Translate() will be called on the query before any processing.

Definition at line 154 of file AwlDatabase.php.

◆ query()

AwlDatabase::query ( $statement)

Returns a PDOStatement object created using this database, the supplied SQL string, and any parameters given.

Parameters
string$sql_query_stringThe SQL string containing optional variable replacements
mixed... Subsequent arguments are positionally replaced into the $sql_query_string

Definition at line 93 of file AwlDatabase.php.

◆ Rollback()

AwlDatabase::Rollback ( )

Cancel a transaction in progress.

Definition at line 128 of file AwlDatabase.php.

◆ TransactionState()

AwlDatabase::TransactionState ( )

Returns the current state of a transaction, indicating if we have begun a transaction, whether the transaction has failed, or if we are not in a transaction.

Returns
int 0 = not started, 1 = in progress, -1 = error pending rollback/commit

Definition at line 145 of file AwlDatabase.php.

◆ TranslateAll()

AwlDatabase::TranslateAll ( $onoff_boolean)

Switches on or off the processing flag controlling whether subsequent calls to AwlDatabase::Prepare are translated as if PrepareTranslated() had been called.

Definition at line 164 of file AwlDatabase.php.

Member Data Documentation

◆ $translate_all

AwlDatabase::$translate_all = false
protected

Holds whether we are translating all statements.

Definition at line 71 of file AwlDatabase.php.

◆ $txnstate

AwlDatabase::$txnstate = 0
protected

#+ @access private Holds the state of the transaction 0 = not started, 1 = in progress, -1 = error pending rollback/commit

Definition at line 66 of file AwlDatabase.php.


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