PHP Класс Pix_Table_Db_Adapter_SQL, pixframework

Наследование: extends Pix_Table_Db_Adapter_Abstract
Показать файл Открыть проект

Открытые методы

Метод Описание
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