PHP 클래스 Horde_Db_Adapter_Oci8, horde

저자: Jan Schneider ([email protected])
상속: extends Horde_Db_Adapter_Base
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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