PHP 클래스 Dibi\Connection

상속: use trait dibi\Strict
파일 보기 프로젝트 열기: dg/dibi 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$onEvent of function (Event $event); Occurs after query is executed

공개 메소드들

메소드 설명
__construct ( $config, $name = NULL ) Connection options: (see driver-specific options too) - lazy (bool) => if TRUE, connection will be established only when required - result (array) => result set options - formatDateTime => date-time format (if empty, DateTime objects will be returned) - profiler (array or bool) - run (bool) => enable profiler? - file => file to log - substitutes (array) => map of driver specific substitutes (under development)
__destruct ( ) : void Automatically frees the resources allocated for this result set.
__sleep ( ) Prevents serialization.
__wakeup ( ) Prevents unserialization.
affectedRows ( ) : integer Gets the number of affected rows. Alias for getAffectedRows().
alias ( &$config, $key, $alias )
begin ( $savepoint = NULL ) : void Begins a transaction (if supported).
command ( ) : dibi\Fluent
commit ( $savepoint = NULL ) : void Commits statements in a transaction.
connect ( ) : void Connects to a database.
createResultSet ( dibi\ResultDriver $resultDriver ) : Result Result set factory.
dataSource ( $args ) : dibi\DataSource Generates (translates) and returns SQL query as DataSource.
delete ( $table ) : dibi\Fluent
disconnect ( ) : void Disconnects from a database.
fetch ( $args ) : Row Executes SQL query and fetch result - shortcut for query() & fetch().
fetchAll ( $args ) : Row[] Executes SQL query and fetch results - shortcut for query() & fetchAll().
fetchPairs ( $args ) : array Executes SQL query and fetch pairs - shortcut for query() & fetchPairs().
fetchSingle ( $args ) : string Executes SQL query and fetch first column - shortcut for query() & fetchSingle().
getAffectedRows ( ) : integer Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
getConfig ( $key = NULL, $default = NULL ) : mixed Returns configuration variable. If no $key is passed, returns the entire array.
getDatabaseInfo ( ) : Dibi\Reflection\Database Gets a information about the current database.
getDriver ( ) : dibi\Driver Returns the driver and connects to a database in lazy mode.
getInsertId ( $sequence = NULL ) : integer Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
getSubstitutes ( ) : HashMap Returns substitution hashmap.
insert ( $table, $args ) : dibi\Fluent
insertId ( $sequence = NULL ) : integer Retrieves the ID generated for an AUTO_INCREMENT column. Alias for getInsertId().
isConnected ( ) : boolean Returns TRUE when connection was established.
literal ( $value ) : dibi\Literal
loadFile ( $file ) : integer Import SQL dump from file.
nativeQuery ( $sql ) : Result | integer Executes the SQL query.
query ( $args ) : Result | integer Generates (translates) and executes SQL query.
rollback ( $savepoint = NULL ) : void Rollback changes in a transaction.
select ( $args ) : dibi\Fluent
substitute ( $value ) : string Provides substitution.
test ( $args ) : boolean Generates and prints SQL query.
translate ( $args ) : string Generates SQL query.
update ( $table, $args ) : dibi\Fluent

보호된 메소드들

메소드 설명
onEvent ( $arg )

비공개 메소드들

메소드 설명
translateArgs ( $args ) : string Generates SQL query.

메소드 상세

__construct() 공개 메소드

Connection options: (see driver-specific options too) - lazy (bool) => if TRUE, connection will be established only when required - result (array) => result set options - formatDateTime => date-time format (if empty, DateTime objects will be returned) - profiler (array or bool) - run (bool) => enable profiler? - file => file to log - substitutes (array) => map of driver specific substitutes (under development)
public __construct ( $config, $name = NULL )

__destruct() 공개 메소드

Automatically frees the resources allocated for this result set.
public __destruct ( ) : void
리턴 void

__sleep() 공개 메소드

Prevents serialization.
public __sleep ( )

__wakeup() 공개 메소드

Prevents unserialization.
public __wakeup ( )

affectedRows() 공개 메소드

Gets the number of affected rows. Alias for getAffectedRows().
public affectedRows ( ) : integer
리턴 integer number of rows

alias() 공개 정적인 메소드

사용 중단:
public static alias ( &$config, $key, $alias )

begin() 공개 메소드

Begins a transaction (if supported).
public begin ( $savepoint = NULL ) : void
리턴 void

command() 공개 메소드

public command ( ) : dibi\Fluent
리턴 dibi\Fluent

commit() 공개 메소드

Commits statements in a transaction.
public commit ( $savepoint = NULL ) : void
리턴 void

connect() 최종 공개 메소드

Connects to a database.
final public connect ( ) : void
리턴 void

createResultSet() 공개 메소드

Result set factory.
public createResultSet ( dibi\ResultDriver $resultDriver ) : Result
$resultDriver dibi\ResultDriver
리턴 Result

dataSource() 최종 공개 메소드

Generates (translates) and returns SQL query as DataSource.
final public dataSource ( $args ) : dibi\DataSource
리턴 dibi\DataSource

delete() 공개 메소드

public delete ( $table ) : dibi\Fluent
리턴 dibi\Fluent

disconnect() 최종 공개 메소드

Disconnects from a database.
final public disconnect ( ) : void
리턴 void

fetch() 공개 메소드

Executes SQL query and fetch result - shortcut for query() & fetch().
public fetch ( $args ) : Row
리턴 Row

fetchAll() 공개 메소드

Executes SQL query and fetch results - shortcut for query() & fetchAll().
public fetchAll ( $args ) : Row[]
리턴 Row[]

fetchPairs() 공개 메소드

Executes SQL query and fetch pairs - shortcut for query() & fetchPairs().
public fetchPairs ( $args ) : array
리턴 array

fetchSingle() 공개 메소드

Executes SQL query and fetch first column - shortcut for query() & fetchSingle().
public fetchSingle ( $args ) : string
리턴 string

getAffectedRows() 공개 메소드

Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
public getAffectedRows ( ) : integer
리턴 integer number of rows

getConfig() 최종 공개 메소드

Returns configuration variable. If no $key is passed, returns the entire array.
또한 보기: self::__construct
final public getConfig ( $key = NULL, $default = NULL ) : mixed
리턴 mixed

getDatabaseInfo() 공개 메소드

Gets a information about the current database.
public getDatabaseInfo ( ) : Dibi\Reflection\Database
리턴 Dibi\Reflection\Database

getDriver() 최종 공개 메소드

Returns the driver and connects to a database in lazy mode.
final public getDriver ( ) : dibi\Driver
리턴 dibi\Driver

getInsertId() 공개 메소드

Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
public getInsertId ( $sequence = NULL ) : integer
리턴 integer

getSubstitutes() 공개 메소드

Returns substitution hashmap.
public getSubstitutes ( ) : HashMap
리턴 HashMap

insert() 공개 메소드

public insert ( $table, $args ) : dibi\Fluent
리턴 dibi\Fluent

insertId() 공개 메소드

Retrieves the ID generated for an AUTO_INCREMENT column. Alias for getInsertId().
public insertId ( $sequence = NULL ) : integer
리턴 integer

isConnected() 최종 공개 메소드

Returns TRUE when connection was established.
final public isConnected ( ) : boolean
리턴 boolean

literal() 공개 정적인 메소드

public static literal ( $value ) : dibi\Literal
리턴 dibi\Literal

loadFile() 공개 메소드

Import SQL dump from file.
public loadFile ( $file ) : integer
리턴 integer count of sql commands

nativeQuery() 최종 공개 메소드

Executes the SQL query.
final public nativeQuery ( $sql ) : Result | integer
리턴 Result | integer result set object (if any)

onEvent() 보호된 메소드

protected onEvent ( $arg )

query() 최종 공개 메소드

Generates (translates) and executes SQL query.
final public query ( $args ) : Result | integer
리턴 Result | integer result set object (if any)

rollback() 공개 메소드

Rollback changes in a transaction.
public rollback ( $savepoint = NULL ) : void
리턴 void

select() 공개 메소드

public select ( $args ) : dibi\Fluent
리턴 dibi\Fluent

substitute() 공개 메소드

Provides substitution.
public substitute ( $value ) : string
리턴 string

test() 최종 공개 메소드

Generates and prints SQL query.
final public test ( $args ) : boolean
리턴 boolean

translate() 최종 공개 메소드

Generates SQL query.
final public translate ( $args ) : string
리턴 string

update() 공개 메소드

public update ( $table, $args ) : dibi\Fluent
리턴 dibi\Fluent

프로퍼티 상세

$onEvent 공개적으로 프로퍼티

of function (Event $event); Occurs after query is executed
public $onEvent