PHP 인터페이스 Airship\Engine\Contract\DBInterface

An interface for database interaction.
파일 보기 프로젝트 열기: paragonie/airship 0 사용 예제들

공개 메소드들

메소드 설명
cell ( string $statement, $params ) : mixed Variadic version of $this->single()
col ( string $statement, integer $offset, $params ) : mixed Variadic version of $this->column()
column ( string $statement, array $params = [], integer $offset ) : mixed Fetch a column
delete ( string $table, array $conditions ) Delete rows in a database table.
first ( string $statement, $params ) : mixed Variadic version of $this->column(), with an offset of 0
getDriver ( ) : string Which database driver are we operating on?
getPdo ( ) : PDO Return the PDO object directly
insert ( string $table, array $map ) Insert a new row to a table in a database.
row ( string $statement, $params ) Similar to $this->run() except it only returns a single row
run ( string $statement, $params ) : mixed Run a query, get a 2D array with all the results
single ( string $statement, array $params = [] ) : mixed Fetch a single result -- useful for SELECT COUNT() queries
update ( string $table, array $changes, array $conditions ) Update a row in a database table.

메소드 상세

cell() 공개 메소드

Variadic version of $this->single()
public cell ( string $statement, $params ) : mixed
$statement string SQL query without user data
$params Parameters
리턴 mixed

col() 공개 메소드

Variadic version of $this->column()
public col ( string $statement, integer $offset, $params ) : mixed
$statement string SQL query without user data
$offset integer - How many columns from the left are we grabbing from each row?
$params Parameters
리턴 mixed

column() 공개 메소드

Fetch a column
public column ( string $statement, array $params = [], integer $offset ) : mixed
$statement string SQL query without user data
$params array Parameters
$offset integer - How many columns from the left are we grabbing from each row?
리턴 mixed

delete() 공개 메소드

Delete rows in a database table.
public delete ( string $table, array $conditions )
$table string - table name
$conditions array - WHERE clause

first() 공개 메소드

Variadic version of $this->column(), with an offset of 0
public first ( string $statement, $params ) : mixed
$statement string SQL query without user data
$params Parameters
리턴 mixed

getDriver() 공개 메소드

Which database driver are we operating on?
public getDriver ( ) : string
리턴 string

getPdo() 공개 메소드

Return the PDO object directly
public getPdo ( ) : PDO
리턴 PDO

insert() 공개 메소드

Insert a new row to a table in a database.
public insert ( string $table, array $map )
$table string - table name
$map array - associative array of which values should be assigned to each field

row() 공개 메소드

Similar to $this->run() except it only returns a single row
public row ( string $statement, $params )
$statement string SQL query without user data
$params Parameters

run() 공개 메소드

Run a query, get a 2D array with all the results
public run ( string $statement, $params ) : mixed
$statement string SQL query without user data
$params Parameters
리턴 mixed - If successful, a 2D array

single() 공개 메소드

Fetch a single result -- useful for SELECT COUNT() queries
public single ( string $statement, array $params = [] ) : mixed
$statement string
$params array
리턴 mixed

update() 공개 메소드

Update a row in a database table.
public update ( string $table, array $changes, array $conditions )
$table string - table name
$changes array - associative array of which values should be assigned to each field
$conditions array - WHERE clause