PHP Class Horde_Db_Adapter_Oci8, horde

Author: Jan Schneider ([email protected])
Inheritance: extends Horde_Db_Adapter_Base
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_schemaClass string Schema class to use.

Méthodes publiques

Méthode Description
_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.

Méthodes protégées

Méthode Description
_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().

Method Details

_errorMessage() protected méthode

Creates a formatted error message from a oci_error() result hash.
protected _errorMessage ( array $error ) : string
$error array Hash returned from oci_error().
Résultat string The formatted error message.

_handleError() protected méthode

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() public méthode

Returns the Oracle name of a character set.
public _oracleCharsetName ( string $charset ) : string
$charset string A charset name.
Résultat string Oracle-normalized charset.

_prepareBlobs() protected méthode

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.
Résultat array A list of fields, blobs, and locators.

adapterName() public méthode

Returns the human-readable name of the adapter. Use mixed case - one can always use downcase if needed.
public adapterName ( ) : string
Résultat string

addLimitOffset() public méthode

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.
Résultat string

beginDbTransaction() public méthode

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

commitDbTransaction() public méthode

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

connect() public méthode

Connect to the db
public connect ( )

disconnect() public méthode

Disconnect from db
public disconnect ( )

execute() public méthode

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.
Résultat resource

insert() public méthode

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.
Résultat integer Last inserted ID.

insertBlob() public méthode

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.
Résultat integer Last inserted ID.

quoteString() public méthode

Quotes a string, escaping any special characters.
public quoteString ( string $string ) : string
$string string
Résultat string

rollbackDbTransaction() public méthode

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

select() public méthode

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.
Résultat Horde_Db_Adapter_Oracle_Result

selectAll() public méthode

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.
Résultat array

selectOne() public méthode

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.
Résultat array

selectValue() public méthode

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.
Résultat string

selectValues() public méthode

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.
Résultat array

supportsMigrations() public méthode

Does this adapter support migrations?
public supportsMigrations ( ) : boolean
Résultat boolean

updateBlob() public méthode

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.

Property Details

$_schemaClass protected_oe property

Schema class to use.
protected string $_schemaClass
Résultat string