PHP 클래스 Pheasant\Database\Mysqli\Table

파일 보기 프로젝트 열기: lox/pheasant

공개 메소드들

메소드 설명
__construct ( $name, $connection ) Constructor
__toString ( ) Return the string name of the table
columns ( ) : array Returns all the database columns in SHOW COLUMN format
create ( $columns, $options = 'charset=utf8 engine=innodb' ) Creates the table, fails if the table exists
createIfNotExists ( $columns, $options = 'charset=utf8 engine=innodb' ) Creates the table if it doesn't exist
delete ( $criteria = NULL ) Deletes rows in the table
drop ( ) Drops the table
dropIfExists ( ) Drops the table if it exists
exists ( ) Determines if the table exists (name only, column definition not checked)
insert ( $data ) Inserts a row into the table
name ( ) Returns the name of the table as a TableName
query ( $criteria = null ) Builds a Query object for the table
replace ( $data ) Inserts a row, or replaces it entirely if a row with the primary key exists
truncate ( ) Truncates the table
update ( $data, Criteria $where, $limit = false ) Updates a row into the table
upsert ( $data ) Tries to update a record, or inserts if it doesn't exist. Worth noting that affectedRows will be 2 on an update, 1 on an insert.
where ( $where, $params = [] ) Builds a TableCriteria object for the table

비공개 메소드들

메소드 설명
_buildSet ( $data ) Builds a series of X=?, Y=?, Z=?

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( $name, $connection )
$name TableName

__toString() 공개 메소드

Return the string name of the table
public __toString ( )

columns() 공개 메소드

Returns all the database columns in SHOW COLUMN format
public columns ( ) : array
리턴 array

create() 공개 메소드

Creates the table, fails if the table exists
public create ( $columns, $options = 'charset=utf8 engine=innodb' )
$columns a map defining columns to Type objects

createIfNotExists() 공개 메소드

Creates the table if it doesn't exist
public createIfNotExists ( $columns, $options = 'charset=utf8 engine=innodb' )

delete() 공개 메소드

Deletes rows in the table
public delete ( $criteria = NULL )

drop() 공개 메소드

Drops the table
public drop ( )

dropIfExists() 공개 메소드

Drops the table if it exists
public dropIfExists ( )

exists() 공개 메소드

Determines if the table exists (name only, column definition not checked)
public exists ( )

insert() 공개 메소드

Inserts a row into the table
public insert ( $data )

name() 공개 메소드

Returns the name of the table as a TableName
public name ( )

query() 공개 메소드

Builds a Query object for the table
public query ( $criteria = null )

replace() 공개 메소드

Inserts a row, or replaces it entirely if a row with the primary key exists
또한 보기: http://dev.mysql.com/doc/refman/5.0/en/replace.html
public replace ( $data )

truncate() 공개 메소드

Truncates the table
public truncate ( )

update() 공개 메소드

Updates a row into the table
public update ( $data, Criteria $where, $limit = false )
$where Pheasant\Query\Criteria

upsert() 공개 메소드

Tries to update a record, or inserts if it doesn't exist. Worth noting that affectedRows will be 2 on an update, 1 on an insert.
public upsert ( $data )

where() 공개 메소드

Builds a TableCriteria object for the table
public where ( $where, $params = [] )