PHP Класс Zend_Db_Adapter_Pdo_Abstract

Наследование: extends Zend_Db_Adapter_Abstract
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_defaultStmtClass string Default class name for a DB statement.

Открытые методы

Метод Описание
closeConnection ( ) : void Force the connection to close.
exec ( mixed $sql ) : integer Executes an SQL statement and return the number of affected rows
getServerVersion ( ) : string Retrieve server version in PHP style
isConnected ( ) : boolean Test if a connection is active
lastInsertId ( string $tableName = null, string $primaryKey = null ) : string Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
prepare ( string $sql ) : PDOStatement Prepares an SQL statement.
query ( string | Zend_Db_Select $sql, array $bind = [] ) : Zend_Db_Statement_Pdo Special handling for PDO query().
setFetchMode ( integer $mode ) : void Set the PDO fetch mode.
supportsParameters ( string $type ) : boolean Check if the adapter supports real SQL parameters.

Защищенные методы

Метод Описание
_beginTransaction ( ) Begin a transaction.
_commit ( ) Commit a transaction.
_connect ( ) : void Creates a PDO object and connects to the database.
_dsn ( ) : string Creates a PDO DSN for the adapter from $this->_config settings.
_quote ( string $value ) : string Quote a raw string.
_rollBack ( ) Roll-back a transaction.

Описание методов

_beginTransaction() защищенный Метод

Begin a transaction.
protected _beginTransaction ( )

_commit() защищенный Метод

Commit a transaction.
protected _commit ( )

_connect() защищенный Метод

Creates a PDO object and connects to the database.
protected _connect ( ) : void
Результат void

_dsn() защищенный Метод

Creates a PDO DSN for the adapter from $this->_config settings.
protected _dsn ( ) : string
Результат string

_quote() защищенный Метод

Quote a raw string.
protected _quote ( string $value ) : string
$value string Raw string
Результат string Quoted string

_rollBack() защищенный Метод

Roll-back a transaction.
protected _rollBack ( )

closeConnection() публичный Метод

Force the connection to close.
public closeConnection ( ) : void
Результат void

exec() публичный Метод

Executes an SQL statement and return the number of affected rows
public exec ( mixed $sql ) : integer
$sql mixed The SQL statement with placeholders. May be a string or Zend_Db_Select.
Результат integer Number of rows that were modified or deleted by the SQL statement

getServerVersion() публичный Метод

Retrieve server version in PHP style
public getServerVersion ( ) : string
Результат string

isConnected() публичный Метод

Test if a connection is active
public isConnected ( ) : boolean
Результат boolean

lastInsertId() публичный Метод

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. On RDBMS brands that don't support sequences, $tableName and $primaryKey are ignored.
public lastInsertId ( string $tableName = null, string $primaryKey = null ) : string
$tableName string OPTIONAL Name of table.
$primaryKey string OPTIONAL Name of primary key column.
Результат string

prepare() публичный Метод

Prepares an SQL statement.
public prepare ( string $sql ) : PDOStatement
$sql string The SQL statement with placeholders.
Результат PDOStatement

query() публичный Метод

All bind parameter names must begin with ':'
public query ( string | Zend_Db_Select $sql, array $bind = [] ) : Zend_Db_Statement_Pdo
$sql string | Zend_Db_Select The SQL statement with placeholders.
$bind array An array of data to bind to the placeholders.
Результат Zend_Db_Statement_Pdo

setFetchMode() публичный Метод

Set the PDO fetch mode.
public setFetchMode ( integer $mode ) : void
$mode integer A PDO fetch mode.
Результат void

supportsParameters() публичный Метод

Check if the adapter supports real SQL parameters.
public supportsParameters ( string $type ) : boolean
$type string 'positional' or 'named'
Результат boolean

Описание свойств

$_defaultStmtClass защищенное свойство

Default class name for a DB statement.
protected string $_defaultStmtClass
Результат string