DboMysqli Class Reference

Inheritance diagram for DboMysqli:

DboSource DataSource Object

List of all members.


Public Member Functions

 _execute ($sql)
 begin (&$model)
 column ($real)
 commit (&$model)
 connect ()
 describe (&$model)
 disconnect ()
 fetchResult ()
 getEncoding ()
 lastAffected ()
 lastError ()
 lastInsertId ($source=null)
 lastNumRows ()
 length ($real)
 listSources ()
 resultSet (&$results)
 rollback (&$model)
 setEncoding ($enc)
 value ($data, $column=null, $safe=false)

Public Attributes

 $_baseConfig
 $columns
 $description = "Mysqli DBO Driver"
 $endQuote = "`"
 $startQuote = "`"

Detailed Description

Definition at line 38 of file dbo_mysqli.php.


Member Function Documentation

DboMysqli::_execute ( sql  ) 

Executes given SQL statement.

Parameters:
string $sql SQL statement
Returns:
resource Result resource identifier protected

Definition at line 121 of file dbo_mysqli.php.

Referenced by listSources(), and setEncoding().

DboMysqli::begin ( &$  model  ) 

Begin a transaction

Parameters:
unknown_type $model
Returns:
boolean True on success, false on fail (i.e. if the database/model does not support transactions).

Reimplemented from DataSource.

Definition at line 229 of file dbo_mysqli.php.

References DboSource::execute().

DboMysqli::column ( real  ) 

Converts database-layer column types to basic types

Parameters:
string $real Real database-layer column type (i.e. "varchar(255)")
Returns:
string Abstract column type (i.e. "string")

Reimplemented from DataSource.

Definition at line 322 of file dbo_mysqli.php.

References length(), DboSource::limit(), and DboSource::name().

Referenced by describe().

DboMysqli::commit ( &$  model  ) 

Commit a transaction

Parameters:
unknown_type $model
Returns:
boolean True on success, false on fail (i.e. if the database/model does not support transactions, or a transaction has not started).

Reimplemented from DataSource.

Definition at line 246 of file dbo_mysqli.php.

References DboSource::execute().

DboMysqli::connect (  ) 

Connects to the database using options in the given configuration array.

Returns:
boolean True if the database could be connected, else false

Definition at line 90 of file dbo_mysqli.php.

References DataSource::$config, and setEncoding().

DboMysqli::describe ( &$  model  ) 

Returns an array of the fields in given table name.

Parameters:
string $tableName Name of database table to inspect
Returns:
array Fields in table. Keys are name and type

Definition at line 154 of file dbo_mysqli.php.

References column(), DboSource::fullTableName(), length(), and DboSource::query().

DboMysqli::disconnect (  ) 

Disconnects from database.

Returns:
boolean True if the database could be disconnected, else false

Definition at line 109 of file dbo_mysqli.php.

DboMysqli::fetchResult (  ) 

Fetches the next row from the current result set

Returns:
unknown

Definition at line 409 of file dbo_mysqli.php.

References DboSource::$index.

DboMysqli::getEncoding (  ) 

Gets the database encoding

Returns:
string The database encoding

Definition at line 437 of file dbo_mysqli.php.

DboMysqli::lastAffected (  ) 

Returns number of affected rows in previous database operation. If no previous operation exists, this returns false.

Returns:
int Number of affected rows

Definition at line 284 of file dbo_mysqli.php.

DboMysqli::lastError (  ) 

Returns a formatted error message from previous database operation.

Returns:
string Error message with error number

Definition at line 272 of file dbo_mysqli.php.

DboMysqli::lastInsertId ( source = null  ) 

Returns the ID generated from the previous INSERT operation.

Parameters:
unknown_type $source
Returns:
in

Reimplemented from DataSource.

Definition at line 308 of file dbo_mysqli.php.

References DboSource::fetchRow().

DboMysqli::lastNumRows (  ) 

Returns number of rows in previous resultset. If no previous resultset exists, this returns false.

Returns:
int Number of rows in resultset

Definition at line 296 of file dbo_mysqli.php.

DboMysqli::length ( real  ) 

Gets the length of a database-native column description, or null if no length

Parameters:
string $real Real database-layer column type (i.e. "varchar(255)")
Returns:
int An integer representing the length of the column

Reimplemented from DboSource.

Definition at line 370 of file dbo_mysqli.php.

Referenced by column(), and describe().

DboMysqli::listSources (  ) 

Returns an array of sources (tables) in the database.

Returns:
array Array of tablenames in the database

Definition at line 129 of file dbo_mysqli.php.

References _execute(), and DboSource::name().

DboMysqli::resultSet ( &$  results  ) 

Enter description here...

Parameters:
unknown_type $results

Definition at line 388 of file dbo_mysqli.php.

References DboSource::$index, and DboSource::name().

DboMysqli::rollback ( &$  model  ) 

Rollback a transaction

Parameters:
unknown_type $model
Returns:
boolean True on success, false on fail (i.e. if the database/model does not support transactions, or a transaction has not started).

Reimplemented from DataSource.

Definition at line 261 of file dbo_mysqli.php.

References DboSource::execute().

DboMysqli::setEncoding ( enc  ) 

Sets the database encoding

Parameters:
string $enc Database encoding
Returns:
void

Definition at line 429 of file dbo_mysqli.php.

References _execute().

Referenced by connect().

DboMysqli::value ( data,
column = null,
safe = false 
)

Returns a quoted and escaped string of $data for use in an SQL statement.

Parameters:
string $data String to be prepared for use in an SQL statement
string $column The column into which this data will be inserted
boolean $safe Whether or not numeric data should be handled automagically if no column data is provided
Returns:
string Quoted and escaped data

Definition at line 190 of file dbo_mysqli.php.

References $data, and DboSource::boolean().


Member Data Documentation

DboMysqli::$_baseConfig

Initial value:

 array('persistent' => true,
                                'host' => 'localhost',
                                'login' => 'root',
                                'password' => '',
                                'database' => 'cake',
                                'port' => '3306',
                                'connect' => 'mysqli_connect')

Reimplemented from DataSource.

Definition at line 62 of file dbo_mysqli.php.

DboMysqli::$columns

Initial value:

 array('primary_key' => array('name' => 'int(11) DEFAULT NULL auto_increment'),
                        'string' => array('name' => 'varchar', 'limit' => '255'),
                        'text' => array('name' => 'text'),
                        'integer' => array('name' => 'int', 'limit' => '11', 'formatter' => 'intval'),
                        'float' => array('name' => 'float', 'formatter' => 'floatval'),
                        'datetime' => array('name' => 'datetime', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
                        'timestamp' => array('name' => 'timestamp', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
                        'time' => array('name' => 'time', 'format' => 'H:i:s', 'formatter' => 'date'),
                        'date' => array('name' => 'date', 'format' => 'Y-m-d', 'formatter' => 'date'),
                        'binary' => array('name' => 'blob'),
                        'boolean' => array('name' => 'tinyint', 'limit' => '1'))

Definition at line 74 of file dbo_mysqli.php.

DboMysqli::$description = "Mysqli DBO Driver"

Reimplemented from DboSource.

Definition at line 44 of file dbo_mysqli.php.

DboMysqli::$endQuote = "`"

Reimplemented from DboSource.

Definition at line 56 of file dbo_mysqli.php.

DboMysqli::$startQuote = "`"

Reimplemented from DboSource.

Definition at line 50 of file dbo_mysqli.php.


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