PHP 클래스 Pix_Table_Db_Adapter_SQL, pixframework

상속: extends Pix_Table_Db_Adapter_Abstract
파일 보기 프로젝트 열기: pixnet/pixframework

공개 메소드들

메소드 설명
bulkInsert ( Pix_Table $table, array $keys, array $values_list, array $options = [] ) : void bulk insert
column_quote ( string $a ) : string column_quote 把 $a 字串加上 quote
deleteOne ( Pix_Table_Row $row ) : void deleteOne 從 db 上刪除一個 Row
fetch ( Pix_Table $table, Pix_Table_Search $search, string $select_columns = '*' ) : array fetch 從 $table 找出符合 $search 的所有 column
fetchCount ( Pix_Table $table, mixed $search ) : integer fetchCount 從 $table 找出符合 $search 條件的數量
fetchOne ( Pix_Table $table, array $primary_values, $select_columns = '*' ) : array fetchOne 從 $table 找出符合 $primary_values 條件的一筆
fetchSum ( Pix_Table $table, string $column, Pix_Table_Search $search ) : mixed fetchSum 從 $table 找出符合 $search 數量的 $column 總合
getSQLConditionByTerm ( Pix_Table_Search_Term $term, $table )
insertOne ( Pix_Table $table, array | string $keys_values ) : void insertOne 從 db 上增加一筆資料
updateOne ( Pix_Table_Row $row, array | string $data ) : void updateOne 從 db 上更新一個 $row 的 data

보호된 메소드들

메소드 설명
_filterRow ( array $row ) : array filter database raw data to Pix_Table_Row data
_getSelectExpression ( Pix_Table $table, string | array $select_columns = '*' ) : string get select expression for SELECT
_get_clause ( Pix_Table_Search $search ) : string _get_clause 從 $search 條件中,回傳 ORDER BY .
_get_set_clause ( mixed $keys_values, $table ) : string _get_set_clause 從 $keys_values 條件中,回傳 SET 後面的 SQL
_get_where_clause ( Pix_Table_Search $search, Pix_Table $table ) : string _get_where_clause 依照 $search 條件以及指定的 $table 回傳 WHERE 的 SQL
_hasSpecialColumns ( Pix_Table $table ) : boolean check $table has special column or not

메소드 상세

_filterRow() 보호된 메소드

filter database raw data to Pix_Table_Row data
protected _filterRow ( array $row ) : array
$row array
리턴 array

_getSelectExpression() 보호된 메소드

get select expression for SELECT
protected _getSelectExpression ( Pix_Table $table, string | array $select_columns = '*' ) : string
$table Pix_Table
$select_columns string | array
리턴 string

_get_clause() 보호된 메소드

.. LIMIT ...
protected _get_clause ( Pix_Table_Search $search ) : string
$search Pix_Table_Search
리턴 string

_get_set_clause() 보호된 메소드

_get_set_clause 從 $keys_values 條件中,回傳 SET 後面的 SQL
protected _get_set_clause ( mixed $keys_values, $table ) : string
$keys_values mixed
리턴 string

_get_where_clause() 보호된 메소드

_get_where_clause 依照 $search 條件以及指定的 $table 回傳 WHERE 的 SQL
protected _get_where_clause ( Pix_Table_Search $search, Pix_Table $table ) : string
$search Pix_Table_Search
$table Pix_Table
리턴 string

_hasSpecialColumns() 보호된 메소드

check $table has special column or not
protected _hasSpecialColumns ( Pix_Table $table ) : boolean
$table Pix_Table
리턴 boolean

bulkInsert() 공개 메소드

bulk insert
public bulkInsert ( Pix_Table $table, array $keys, array $values_list, array $options = [] ) : void
$table Pix_Table
$keys array
$values_list array
$options array
리턴 void

column_quote() 공개 메소드

column_quote 把 $a 字串加上 quote
public column_quote ( string $a ) : string
$a string
리턴 string

deleteOne() 공개 메소드

deleteOne 從 db 上刪除一個 Row
public deleteOne ( Pix_Table_Row $row ) : void
$row Pix_Table_Row
리턴 void

fetch() 공개 메소드

fetch 從 $table 找出符合 $search 的所有 column
public fetch ( Pix_Table $table, Pix_Table_Search $search, string $select_columns = '*' ) : array
$table Pix_Table
$search Pix_Table_Search
$select_columns string
리턴 array

fetchCount() 공개 메소드

fetchCount 從 $table 找出符合 $search 條件的數量
public fetchCount ( Pix_Table $table, mixed $search ) : integer
$table Pix_Table
$search mixed
리턴 integer

fetchOne() 공개 메소드

fetchOne 從 $table 找出符合 $primary_values 條件的一筆
public fetchOne ( Pix_Table $table, array $primary_values, $select_columns = '*' ) : array
$table Pix_Table
$primary_values array
리턴 array or null

fetchSum() 공개 메소드

fetchSum 從 $table 找出符合 $search 數量的 $column 總合
public fetchSum ( Pix_Table $table, string $column, Pix_Table_Search $search ) : mixed
$table Pix_Table
$column string
$search Pix_Table_Search
리턴 mixed

getSQLConditionByTerm() 공개 메소드

public getSQLConditionByTerm ( Pix_Table_Search_Term $term, $table )
$term Pix_Table_Search_Term

insertOne() 공개 메소드

insertOne 從 db 上增加一筆資料
public insertOne ( Pix_Table $table, array | string $keys_values ) : void
$table Pix_Table
$keys_values array | string
리턴 void

updateOne() 공개 메소드

updateOne 從 db 上更新一個 $row 的 data
public updateOne ( Pix_Table_Row $row, array | string $data ) : void
$row Pix_Table_Row
$data array | string
리턴 void