DboMysqli Class Reference

Public Member Functions | |
| _execute ($sql) | |
| _executeProcedure ($sql) | |
| begin (&$model) | |
| column ($real) | |
| connect () | |
| describe (&$model) | |
| disconnect () | |
| fetchResult () | |
| getEncoding () | |
| hasResult () | |
| lastAffected () | |
| lastError () | |
| lastInsertId ($source=null) | |
| lastNumRows () | |
| length ($real) | |
| listSources () | |
| resultSet (&$results) | |
| setEncoding ($enc) | |
| value ($data, $column=null, $safe=false) | |
Public Attributes | |
| $_baseConfig | |
| $columns | |
| $description = "Mysqli DBO Driver" | |
| $endQuote = "`" | |
| $index = array('PRI' => 'primary', 'MUL' => 'index', 'UNI' => 'unique') | |
| $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 140 of file dbo_mysqli.php.
References _executeProcedure().
Referenced by listSources(), and setEncoding().
| DboMysqli::_executeProcedure | ( | $ | sql | ) |
Executes given SQL statement (procedure call).
- Parameters:
-
string $sql SQL statement (procedure call)
- Returns:
- resource Result resource identifier for first recordset protected
Definition at line 154 of file dbo_mysqli.php.
Referenced by _execute().
| 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 DboSource.
Definition at line 272 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 334 of file dbo_mysqli.php.
References length(), DboSource::limit(), and DboSource::name().
Referenced by describe().
| 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 101 of file dbo_mysqli.php.
References DataSource::$config, 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 194 of file dbo_mysqli.php.
References column(), DboSource::fullTableName(), DboSource::index(), length(), and DboSource::query().
| DboMysqli::disconnect | ( | ) |
Disconnects from database.
- Returns:
- boolean True if the database could be disconnected, else false
Definition at line 128 of file dbo_mysqli.php.
| DboMysqli::fetchResult | ( | ) |
Fetches the next row from the current result set
- Returns:
- unknown
Definition at line 423 of file dbo_mysqli.php.
References $index.
| DboMysqli::getEncoding | ( | ) |
Gets the database encoding
- Returns:
- string The database encoding
Definition at line 453 of file dbo_mysqli.php.
| DboMysqli::hasResult | ( | ) |
Checks if the result is valid
- Returns:
- boolean True if the result is valid, else false
Reimplemented from DboSource.
Definition at line 461 of file dbo_mysqli.php.
Referenced by lastNumRows().
| DboMysqli::lastAffected | ( | ) |
Returns number of affected rows in previous database operation. If no previous operation exists, this returns false.
- Returns:
- integer Number of affected rows
Definition at line 296 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 284 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 320 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:
- integer Number of rows in resultset
Definition at line 308 of file dbo_mysqli.php.
References hasResult().
| 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:
- integer An integer representing the length of the column
Reimplemented from DboSource.
Definition at line 384 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 169 of file dbo_mysqli.php.
References _execute(), config(), and DboSource::name().
| DboMysqli::resultSet | ( | &$ | results | ) |
Enter description here...
- Parameters:
-
unknown_type $results
Definition at line 402 of file dbo_mysqli.php.
References $index, and DboSource::name().
| DboMysqli::setEncoding | ( | $ | enc | ) |
Sets the database encoding
- Parameters:
-
string $enc Database encoding
Definition at line 445 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 233 of file dbo_mysqli.php.
References 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 69 of file dbo_mysqli.php.
| DboMysqli::$columns |
Initial value:
array(
'primary_key' => array('name' => '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 83 of file dbo_mysqli.php.
| DboMysqli::$description = "Mysqli DBO Driver" |
| DboMysqli::$endQuote = "`" |
| DboMysqli::$index = array('PRI' => 'primary', 'MUL' => 'index', 'UNI' => 'unique') |
Reimplemented from DboSource.
Definition at line 62 of file dbo_mysqli.php.
Referenced by fetchResult(), and resultSet().
| DboMysqli::$startQuote = "`" |
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/libs/model/datasources/dbo/dbo_mysqli.php