Public Member Functions | Protected Member Functions | Protected Attributes

Zend_Db_Adapter_Mysqli Class Reference

Inheritance diagram for Zend_Db_Adapter_Mysqli:
Zend_Db_Adapter_Abstract

Public Member Functions

 getQuoteIdentifierSymbol ()
 listTables ()
 describeTable ($tableName, $schemaName=null)
 isConnected ()
 closeConnection ()
 prepare ($sql)
 lastInsertId ($tableName=null, $primaryKey=null)
 setFetchMode ($mode)
 limit ($sql, $count, $offset=0)
 supportsParameters ($type)
 getServerVersion ()

Protected Member Functions

 _quote ($value)
 _connect ()
 _beginTransaction ()
 _commit ()
 _rollBack ()

Protected Attributes

 $_numericDataTypes
 $_stmt = null
 $_defaultStmtClass = 'Zend_Db_Statement_Mysqli'

Detailed Description

Definition at line 52 of file Mysqli.php.


Member Function Documentation

_beginTransaction (  ) [protected]

Begin a transaction.

Returns:
void

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 418 of file Mysqli.php.

_commit (  ) [protected]

Commit a transaction.

Returns:
void

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 429 of file Mysqli.php.

_connect (  ) [protected]

Creates a connection to the database.

Returns:
void
Exceptions:
Zend_Db_Adapter_Mysqli_Exception

See also:
Zend_Db_Adapter_Mysqli_Exception
Zend_Db_Adapter_Mysqli_Exception

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 280 of file Mysqli.php.

_quote ( value ) [protected]

Quote a raw string.

Parameters:
mixed$valueRaw string
Returns:
string Quoted string

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 104 of file Mysqli.php.

_rollBack (  ) [protected]

Roll-back a transaction.

Returns:
void

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 441 of file Mysqli.php.

closeConnection (  )

Force the connection to close.

Returns:
void

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 356 of file Mysqli.php.

describeTable ( tableName,
schemaName = null 
)

Returns the column descriptions for a table.

The return value is an associative array keyed by the column name, as returned by the RDBMS.

The value of each array element is an associative array with the following keys:

SCHEMA_NAME => string; name of database or schema TABLE_NAME => string; COLUMN_NAME => string; column name COLUMN_POSITION => number; ordinal position of column in table DATA_TYPE => string; SQL datatype name of column DEFAULT => string; default expression of column, null if none NULLABLE => boolean; true if column can have nulls LENGTH => number; length of CHAR/VARCHAR SCALE => number; scale of NUMERIC/DECIMAL PRECISION => number; precision of NUMERIC/DECIMAL UNSIGNED => boolean; unsigned property of an integer type PRIMARY => boolean; true if column is part of the primary key PRIMARY_POSITION => integer; position of column in primary key IDENTITY => integer; true if column is auto-generated with unique values

Parameters:
string$tableName
string$schemaNameOPTIONAL
Returns:
array

Todo:
use INFORMATION_SCHEMA someday when MySQL's implementation isn't too slow.

Use mysqli extension API, because DESCRIBE doesn't work well as a prepared statement on MySQL 4.1.

See also:
Zend_Db_Adapter_Mysqli_Exception

The optional argument of a MySQL int type is not precision or length; it is only a hint for display width.

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 177 of file Mysqli.php.

getQuoteIdentifierSymbol (  )

Returns the symbol the adapter uses for delimiting identifiers.

Returns:
string

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 118 of file Mysqli.php.

getServerVersion (  )

Retrieve server version in PHP style

Returns:
string

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 540 of file Mysqli.php.

isConnected (  )

Test if a connection is active

Returns:
boolean

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 346 of file Mysqli.php.

lastInsertId ( tableName = null,
primaryKey = null 
)

Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.

As a convention, on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence from the arguments and returns the last id generated by that sequence. On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method returns the last value generated for such a column, and the table name argument is disregarded.

MySQL does not support sequences, so $tableName and $primaryKey are ignored.

Parameters:
string$tableNameOPTIONAL Name of table.
string$primaryKeyOPTIONAL Name of primary key column.
Returns:
string
Todo:
Return value should be int?

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 407 of file Mysqli.php.

limit ( sql,
count,
offset = 0 
)

Adds an adapter-specific LIMIT clause to the SELECT statement.

Parameters:
string$sql
int$count
int$offsetOPTIONAL
Returns:
string

See also:
Zend_Db_Adapter_Mysqli_Exception
Zend_Db_Adapter_Mysqli_Exception

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 490 of file Mysqli.php.

listTables (  )

Returns a list of the tables in the database.

Returns:
array

See also:
Zend_Db_Adapter_Mysqli_Exception

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 128 of file Mysqli.php.

prepare ( sql )

Prepare a statement and return a PDOStatement-like object.

Parameters:
string$sqlSQL query
Returns:
Zend_Db_Statement_Mysqli

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 370 of file Mysqli.php.

setFetchMode ( mode )

Set the fetch mode.

Parameters:
int$mode
Returns:
void
Exceptions:
Zend_Db_Adapter_Mysqli_Exception

See also:
Zend_Db_Adapter_Mysqli_Exception
Zend_Db_Adapter_Mysqli_Exception

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 455 of file Mysqli.php.

supportsParameters ( type )

Check if the adapter supports real SQL parameters.

Parameters:
string$type'positional' or 'named'
Returns:
bool

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 524 of file Mysqli.php.


Field Documentation

$_numericDataTypes [protected]
Initial value:
 array(
        Zend_Db::INT_TYPE    => Zend_Db::INT_TYPE,
        Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
        Zend_Db::FLOAT_TYPE  => Zend_Db::FLOAT_TYPE,
        'INT'                => Zend_Db::INT_TYPE,
        'INTEGER'            => Zend_Db::INT_TYPE,
        'MEDIUMINT'          => Zend_Db::INT_TYPE,
        'SMALLINT'           => Zend_Db::INT_TYPE,
        'TINYINT'            => Zend_Db::INT_TYPE,
        'BIGINT'             => Zend_Db::BIGINT_TYPE,
        'SERIAL'             => Zend_Db::BIGINT_TYPE,
        'DEC'                => Zend_Db::FLOAT_TYPE,
        'DECIMAL'            => Zend_Db::FLOAT_TYPE,
        'DOUBLE'             => Zend_Db::FLOAT_TYPE,
        'DOUBLE PRECISION'   => Zend_Db::FLOAT_TYPE,
        'FIXED'              => Zend_Db::FLOAT_TYPE,
        'FLOAT'              => Zend_Db::FLOAT_TYPE
    )

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 66 of file Mysqli.php.


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