PHP 클래스 Horde_Db_Adapter_Mysql, horde

저자: Mike Naberezny ([email protected])
저자: Derek DeVries ([email protected])
저자: Chuck Hagenbuch ([email protected])
상속: extends Horde_Db_Adapter_Base
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_insertId integer Last auto-generated insert_id
$_schemaClass string

공개 메소드들

메소드 설명
adapterName ( ) : string Returns the human-readable name of the adapter. Use mixed case - one can always use downcase if needed.
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 ) : resource Executes the SQL statement in the context of this connection.
insert ( string $sql, mixed $arg1 = null, string $arg2 = null, string $pk = null, integer $idValue = null, string $sequenceName = null ) Returns the last auto-generated ID from the affected table.
isActive ( ) : boolean Check if the connection is active
quoteString ( string $string ) : string Quotes a string, escaping any ' (single quote) and \ (backslash) 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_Mysql_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 ) 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 | boolean 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 ) Returns an array of the values of the first column in a select: select_values("SELECT id FROM companies LIMIT 3") => [1,2,3]
supportsMigrations ( ) : boolean Does this adapter support migrations? Backend specific, as the abstract adapter always returns +false+.

보호된 메소드들

메소드 설명
_errorCode ( string $sqlstate, integer $errno ) : integer Return a standard error code
_parseConfig ( ) : array Parse configuration array into options for mysql_connect

메소드 상세

_errorCode() 보호된 메소드

Return a standard error code
protected _errorCode ( string $sqlstate, integer $errno ) : integer
$sqlstate string
$errno integer
리턴 integer

_parseConfig() 보호된 메소드

Parse configuration array into options for mysql_connect
protected _parseConfig ( ) : array
리턴 array [host, username, password, dbname]

adapterName() 공개 메소드

Returns the human-readable name of the adapter. Use mixed case - one can always use downcase if needed.
public adapterName ( ) : string
리턴 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.
사용 중단: Deprecated for external usage. Use select() instead.
public execute ( string $sql, mixed $arg1 = null, string $arg2 = null ) : 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() 공개 메소드

Returns the last auto-generated ID from the affected table.
public insert ( string $sql, mixed $arg1 = null, string $arg2 = null, string $pk = null, integer $idValue = null, string $sequenceName = null )
$sql string
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
$pk string
$idValue integer
$sequenceName string

isActive() 공개 메소드

Check if the connection is active
public isActive ( ) : boolean
리턴 boolean

quoteString() 공개 메소드

.
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_Mysql_Result
$sql string
$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_Mysql_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 )
$sql string
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.

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 | boolean
$sql string A query.
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
리턴 array | boolean A record hash or false if no record found.

selectValue() 공개 메소드

Returns a single value from a record
public selectValue ( string $sql, mixed $arg1 = null, string $arg2 = null ) : string
$sql string
$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: select_values("SELECT id FROM companies LIMIT 3") => [1,2,3]
public selectValues ( string $sql, mixed $arg1 = null, string $arg2 = null )
$sql string
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.

supportsMigrations() 공개 메소드

Does this adapter support migrations? Backend specific, as the abstract adapter always returns +false+.
public supportsMigrations ( ) : boolean
리턴 boolean

프로퍼티 상세

$_insertId 보호되어 있는 프로퍼티

Last auto-generated insert_id
protected int $_insertId
리턴 integer

$_schemaClass 보호되어 있는 프로퍼티

protected string $_schemaClass
리턴 string