Implementation of an adapter using the mySQLi module.

see \global\WebLab_Data_Adapter
author Jorgen Evens
package WebLab
subpackage Data_MySQLi

 Methods

Constructor for WebLab_Data_MySQLi_Adapter.

__construct(mixed $login) 

Parameters

$login

mixed

Credentials to be used during connection setup.

Escape a string using the database specific escape function.

escape_string(string $str) : string

Parameters

$str

string

Input to be escaped.

Returns

stringEscaped version of $str.

Get database specific information.

getAdapterSpecification() : object
Inherited

This returns a reference to escape_string() and the wildcard.

see \$_wildcard
see \escape_string()
see \getAdapterSpecs()
inherited_from \WebLab_Data_Adapter::getAdapterSpecification()

Returns

object

Retrieve information about the database engine.

getAdapterSpecs() : mixed

This returns a reference to escape_string() and the wildcard.

Returns

mixedDatabase specification settings.

Return the prefix for this database.

getPrefix() : string
Inherited
inherited_from \WebLab_Data_Adapter::getPrefix()

Returns

string

Retrieve the last inserted id

insert_id() : int

Returns

intThe last inserted id.

Return whether adapter is connected.

isConnected() : boolean

Returns

booleanIs adapter connected?

Create a new query to be run on this database.

newQuery() : \WebLab_Data_MySQLi_Query

Performs a query.

query(string $query) 
Inherited

Prefixes the query tables if a prefix is specified.

inherited_from \WebLab_Data_Adapter::query()

Parameters

$query

string

Decrease transaction depth.

quitTransaction(boolean $commit) 
Inherited

When transaction depth reaches 0 transaction will be commited.

When performing a rollback, transaction depth will be reset to 0 and the entire tree will be rolled back.

inherited_from \WebLab_Data_Adapter::quitTransaction()

Parameters

$commit

boolean

Set the prefix used while querying this database.

setPrefix(string $prefix) : \WebLab_Data_Adapter
Inherited
inherited_from \WebLab_Data_Adapter::setPrefix()

Parameters

$prefix

string

Returns

Start a transaction and increase the transaction depth

startTransaction() 
Inherited
see \$_transaction_depth
see \_start_transaction()
inherited_from \WebLab_Data_Adapter::startTransaction()

Pass on a query to the underlying connection.

_query(\WebLab_Data_MySQLi_Query $query) : \WebLab_Data_MySQLi_Result

Parameters

$query

\WebLab_Data_MySQLi_Query

The query to execute.

Returns

\WebLab_Data_MySQLi_ResultThe result of the query.

Notify the database engine that a transaction is to be stopped.

_quit_transaction(boolean $commit) 

Parameters

$commit

boolean

Should the result be saved

Notify the database engine that a transaction is about to start.

_start_transaction() 

 Properties

 

$error : string
Inherited
inherited_from \WebLab_Data_Adapter::$$error
 

$_connected : boolean
 

$_original_strings : array
Inherited
inherited_from \WebLab_Data_Adapter::$$_original_strings
 

$_prefix : string
Inherited
inherited_from \WebLab_Data_Adapter::$$_prefix
 

$_resource : resource
Inherited
inherited_from \WebLab_Data_Adapter::$$_resource
 

$_transaction_depth : int
Inherited

This allows for transaction nesting.

see \startTransaction()
inherited_from \WebLab_Data_Adapter::$$_transaction_depth
 

$_wildcard : \char