Pix_Table
相關 Setting
Table:DropTableEnable 是否允許可以透過 Pix_Table dropTable, 預設 disable
package |
Table |
copyright |
2003-2012 PIXNET Digital Media Corporation |
license |
BSD License |
Methods
__call()
__call($name, $args)
__callStatic()
__callStatic($name, $args)
__construct()
__construct()
addFilter()
addFilter($filter, $funcname)
Parameters
$filter
$funcname
addIndex 增加一組 INDEX
addIndex(string $name, array $columns, string $type) : void
addResultSetHelper add ResultSet Helper to this Table
addResultSetHelper(string $helper, array $methods, array $options) : void
Parameters
$helper
string
$methods
array
$options
array
addRowHelper add Row Helper to this Table
addRowHelper(string $helper, array $methods, array $options) : void
Parameters
$helper
string
$methods
array
$options
array
addStaticResultSetHelper add ResuletSet Helper to all Table
addStaticResultSetHelper(string $helper, array $methods, array $options) : void
Parameters
$helper
string
$methods
array
$options
array
addStaticRowHelper add Row Helper to all Table
addStaticRowHelper(string $helper, array $methods, array $options) : void
Parameters
$helper
string
$methods
array
$options
array
addStaticTableHelper add Table Helper to all Table
addStaticTableHelper(string $helper, array $methods, array $options) : void
Parameters
$helper
string
$methods
array
$options
array
addTableHelper add Table Helper to this Table
addTableHelper(string $helper, array $methods, array $options) : void
Parameters
$helper
string
$methods
array
$options
array
bulk insert
bulkInsert(array $keys, array $values_list, array $options) : void
Parameters
$keys
array
$values_list
array
cacheRow
cacheRow(array $primary_values, array $data) : void
Parameters
$primary_values
array
Primary values
$data
array
checkTable 檢查 Table 與資料庫上的不同
checkTable() : array
createTable 在資料庫上建立新 Table
createTable() : void
disableCache 關閉 Pix_Table 的 cache 功能
disableCache(mixed $group) : void
disableLog 停用某個 LOG
disableLog(mixed $group) : void
disableTableCache 停用 Table Cache
disableTableCache() : void
dropTable 刪除這個 table
dropTable() : void
enableCache 開啟 Pix_Table 的 cache 功能
enableCache(mixed $group) : void
enableLog 啟用某個 LOG
enableLog(mixed $group) : void
enableTableCache 啟用 Table Cache
enableTableCache($cache_prefix) : void
find 透過 $primary_value 這個 pk 取得一筆 row
find(mixed $primary_value) : \Pix_Table_Row | null
Parameters
$primary_value
mixed
Returns
findUniqueKey 尋找這要用哪一個 Unique Key
findUniqueKey(array $columns) : string | null
Parameters
Returns
string
null
哪一組 index
find_by()
find_by($columns, $values)
Parameters
$columns
$values
getCacheStatus 取得某個 group 的 cache 功能是開是關
getCacheStatus(string $group) : void
getClass 回傳這個 table 的 class name
getClass() : void
getDefaultDb 取得預設的 Db
getDefaultDb() : void
getFilters()
getFilters()
getForceMaster 取得是否要強制從 master 抓資料的設定
getForceMaster() : boolean
getHelperManager get Pix_Helper_Manager from this table
getHelperManager(string $type) : \Pix_Helper_Manager
Parameters
$type
string
Returns
getIndexColumns()
getIndexColumns($name)
getIndexes get Table index list
getIndexes() : array
getLogStatus 取得某個 log 的狀態
getLogStatus(mixed $group) : void
getLongQueryTime 取得 Slow query 的設定秒數
getLongQueryTime() :
getPrimaryColumns()
getPrimaryColumns()
getRelationForeignKeys 取得某個 relation 的 relation name
getRelationForeignKeys(string $relation) : array
Parameters
$relation
string
relation 名稱
Returns
array
relation 的 columns
getRelationForeignTable 取得 relation 對應的 table
getRelationForeignTable(string $relation) : \Pix_Table
Parameters
$relation
string
relation 名稱
Returns
getRowFromCache 從 Cache 中取得 Row
getRowFromCache(array $primary_values) : false
Parameters
$primary_values
array
Primary values
Returns
false
- 沒有 cache 到或不支援 cache, null - cache 到 null, Pix_Table_Row cache 到的 row
getStaticHelperManager get Pix_Helper_Manager from static Pix_Table
getStaticHelperManager(string $type) : \Pix_Helper_Manager
Parameters
$type
string
Returns
getTable()
getTable($table)
getTableName 取得 Table 名稱
getTableName() : string
init 第一次 load table 進來要做的事,替代掉 __contstruct
init() : void
insert 新增一筆資料進資料庫(立刻會存進資料庫)
insert(mixed $data) : void
isEditableKey 是否是可以被修改的 Row Key, Ex: column, relation ...
isEditableKey(string $key) : boolean
Parameters
$key
string
Returns
boolean
isNumbericColumn 回傳現在這個 column 是不是只有數字
isNumbericColumn(string $column) : boolean
Parameters
$column
string
column name
Returns
boolean
is_a $object 是否是 $table 類型的 Row
is_a(\Pix_Table_Row $object, string $table) : boolean
Parameters
$table
string
Returns
boolean
declare a new empty Pix Table
newEmptyTable($table_name) : \Pix_Table
Parameters
$table_name
Returns
setCache()
setCache($cache)
setClassName()
setClassName($name)
setDefaultDb 指定 Pix_Table 預設的 db
setDefaultDb(\Pix_Table_Db $db) : void
setForceMaster 設定要不要強制從 master 抓資料。
setForceMaster(mixed $enable) : void
setLongQueryTime 當 Query 時間超過這個時間時,會噴出 Warning log
setLongQueryTime(int $second) : void
Properties
_aliases 建立 relation 的 aliases
$_aliases : array
記錄哪些東西要 Cache
$_cache_groups
$_cache_rows
$_cache_rows
_columns 這個 Table 有哪些 column
$_columns : array
$_force_master
$_force_master
_hooks 這個 Table 有哪些 hook
$_hooks : array
_indexes 該 Table 用到的 index
$_indexes : array
deprecated |
use Table->addIndex instead |
access |
public |
_name 這個 Table 在 Db 上面的名稱是什麼
$_name : string
_primary Primary key, 可以是
$_primary : string | array
_relations 這個 Table 有哪些 relation
$_relations : array
_resultSetClass 這個 Table 的 ResultSet class
$_resultSetClass : string
_rowClass 這個 Table 的 Row class
$_rowClass : string
$_save_memory
$_save_memory
Constants
LOG_ARRAYCACHE
LOG_ARRAYCACHE
LOG_SLOWQUERY
LOG_SLOWQUERY