PHP Класс Horde_Db_Adapter_Oci8, horde

Автор: Jan Schneider ([email protected])
Наследование: extends Horde_Db_Adapter_Base
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$_schemaClass string Schema class to use.

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

Метод Описание
_oracleCharsetName ( string $charset ) : string Returns the Oracle name of a character set.
adapterName ( ) : string Returns the human-readable name of the adapter. Use mixed case - one can always use downcase if needed.
addLimitOffset ( string $sql, array $options ) : string Appends LIMIT and OFFSET options to a SQL statement.
beginDbTransaction ( ) Begins the transaction (and turns off auto-committing).
commitDbTransaction ( ) Commits the transaction (and turns on auto-committing).
connect ( ) Connect to the db
disconnect ( ) Disconnect from db
execute ( string $sql, mixed $arg1 = null, string $arg2 = null, $lobs = [] ) : resource Executes the SQL statement in the context of this connection.
insert ( string $sql, array | string $arg1 = null, string $arg2 = null, string $pk = null, integer $idValue = null, string $sequenceName = null ) : integer Inserts a row into a table.
insertBlob ( string $table, array $fields, string $pk = null, integer $idValue = null ) : integer Inserts a row including BLOBs into a table.
quoteString ( string $string ) : string Quotes a string, escaping any special characters.
rollbackDbTransaction ( ) Rolls back the transaction (and turns on auto-committing). Must be done if the transaction block raises an exception or returns false.
select ( string $sql, mixed $arg1 = null, string $arg2 = null ) : Horde_Db_Adapter_Oracle_Result Returns an array of records with the column names as keys, and column values as values.
selectAll ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array Returns an array of record hashes with the column names as keys and column values as values.
selectOne ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array Returns a record hash with the column names as keys and column values as values.
selectValue ( string $sql, mixed $arg1 = null, string $arg2 = null ) : string Returns a single value from a record
selectValues ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array Returns an array of the values of the first column in a select: selectValues("SELECT id FROM companies LIMIT 3") => [1,2,3]
supportsMigrations ( ) : boolean Does this adapter support migrations?
updateBlob ( string $table, array $fields, string | array $where = null ) Updates rows including BLOBs into a table.

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

Метод Описание
_errorMessage ( array $error ) : string Creates a formatted error message from a oci_error() result hash.
_handleError ( resource $resource, string $method ) Log and throws an exception for the last error.
_prepareBlobs ( array $fields ) : array Prepares a list of field values to be consumed by insertBlob() or updateBlob().

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

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

Creates a formatted error message from a oci_error() result hash.
protected _errorMessage ( array $error ) : string
$error array Hash returned from oci_error().
Результат string The formatted error message.

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

Log and throws an exception for the last error.
protected _handleError ( resource $resource, string $method )
$resource resource The resource (connection or statement) to call oci_error() upon.
$method string The calling method.

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

Returns the Oracle name of a character set.
public _oracleCharsetName ( string $charset ) : string
$charset string A charset name.
Результат string Oracle-normalized charset.

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

Prepares a list of field values to be consumed by insertBlob() or updateBlob().
protected _prepareBlobs ( array $fields ) : array
$fields array A hash of column names and values. BLOB columns must be provided as Horde_Db_Value_Binary objects.
Результат array A list of fields, blobs, and locators.

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

Returns the human-readable name of the adapter. Use mixed case - one can always use downcase if needed.
public adapterName ( ) : string
Результат string

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

Appends LIMIT and OFFSET options to a SQL statement.
public addLimitOffset ( string $sql, array $options ) : string
$sql string SQL statement.
$options array Hash with 'limit' and (optional) 'offset' values.
Результат string

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

Begins the transaction (and turns off auto-committing).
public beginDbTransaction ( )

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

Commits the transaction (and turns on auto-committing).
public commitDbTransaction ( )

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

Connect to the db
public connect ( )

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

Disconnect from db
public disconnect ( )

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

Executes the SQL statement in the context of this connection.
public execute ( string $sql, mixed $arg1 = null, string $arg2 = null, $lobs = [] ) : resource
$sql string SQL statement.
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
Результат resource

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

Inserts a row into a table.
public insert ( string $sql, array | string $arg1 = null, string $arg2 = null, string $pk = null, integer $idValue = null, string $sequenceName = null ) : integer
$sql string SQL statement.
$arg1 array | string Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
$pk string The primary key column.
$idValue integer The primary key value. This parameter is required if the primary key is inserted manually.
$sequenceName string The sequence name.
Результат integer Last inserted ID.

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

Inserts a row including BLOBs into a table.
public insertBlob ( string $table, array $fields, string $pk = null, integer $idValue = null ) : integer
$table string The table name.
$fields array A hash of column names and values. BLOB columns must be provided as Horde_Db_Value_Binary objects.
$pk string The primary key column.
$idValue integer The primary key value. This parameter is required if the primary key is inserted manually.
Результат integer Last inserted ID.

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

Quotes a string, escaping any special characters.
public quoteString ( string $string ) : string
$string string
Результат string

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

Rolls back the transaction (and turns on auto-committing). Must be done if the transaction block raises an exception or returns false.

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

Returns an array of records with the column names as keys, and column values as values.
public select ( string $sql, mixed $arg1 = null, string $arg2 = null ) : Horde_Db_Adapter_Oracle_Result
$sql string SQL statement.
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
Результат Horde_Db_Adapter_Oracle_Result

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

Returns an array of record hashes with the column names as keys and column values as values.
public selectAll ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array
$sql string SQL statement.
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
Результат array

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

Returns a record hash with the column names as keys and column values as values.
public selectOne ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array
$sql string SQL statement.
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
Результат array

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

Returns a single value from a record
public selectValue ( string $sql, mixed $arg1 = null, string $arg2 = null ) : string
$sql string SQL statement.
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
Результат string

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

Returns an array of the values of the first column in a select: selectValues("SELECT id FROM companies LIMIT 3") => [1,2,3]
public selectValues ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array
$sql string SQL statement.
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
Результат array

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

Does this adapter support migrations?
public supportsMigrations ( ) : boolean
Результат boolean

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

Updates rows including BLOBs into a table.
public updateBlob ( string $table, array $fields, string | array $where = null )
$table string The table name.
$fields array A hash of column names and values. BLOB columns must be provided as Horde_Db_Value_Binary objects.
$where string | array A WHERE clause. Either a complete clause or an array containing a clause with placeholders and a list of values.

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

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

Schema class to use.
protected string $_schemaClass
Результат string