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) 

Parameters

$name

$args

__callStatic()

__callStatic($name, $args) 

Parameters

$name

$args

__construct()

__construct() 

addFilter()

addFilter($filter, $funcname) 

Parameters

$filter

$funcname

addIndex 增加一組 INDEX

addIndex(string $name, array $columns, string $type) : void

static
access public

Parameters

$name

string

增加 INDEX 名稱

$columns

array

哪個 column

$type

string

index|unique

addResultSetHelper add ResultSet Helper to this Table

addResultSetHelper(string $helper, array $methods, array $options) : void

access public

Parameters

$helper

string

$methods

array

$options

array

addRowHelper add Row Helper to this Table

addRowHelper(string $helper, array $methods, array $options) : void

access public

Parameters

$helper

string

$methods

array

$options

array

addStaticResultSetHelper add ResuletSet Helper to all Table

addStaticResultSetHelper(string $helper, array $methods, array $options) : void

access public

Parameters

$helper

string

$methods

array

$options

array

addStaticRowHelper add Row Helper to all Table

addStaticRowHelper(string $helper, array $methods, array $options) : void

access public

Parameters

$helper

string

$methods

array

$options

array

addStaticTableHelper add Table Helper to all Table

addStaticTableHelper(string $helper, array $methods, array $options) : void

access public

Parameters

$helper

string

$methods

array

$options

array

addTableHelper add Table Helper to this Table

addTableHelper(string $helper, array $methods, array $options) : void

access public

Parameters

$helper

string

$methods

array

$options

array

bulk insert

bulkInsert(array $keys, array $values_list, array $options) : void

static
access public

Parameters

$keys

array

$values_list

array

$options

array

(optional)

cacheRow

cacheRow(array $primary_values, array $data) : void

access public

Parameters

$primary_values

array

Primary values

$data

array

checkTable 檢查 Table 與資料庫上的不同

checkTable() : array

static
access public

Returns

array不同點

createRow 新增加一個未被存入資料庫內的 row

createRow(\Pix_Table_Row | null $belong_row) : \Pix_Table_Row

static
access public

Parameters

$belong_row

\Pix_Table_Rownull

是從哪個 Row 被 create 出來的,Pix_Table 不會用到,但是先預留

Returns

createTable 在資料庫上建立新 Table

createTable() : void

static
access public

debug()

debug($word) 

Parameters

$word

disableCache 關閉 Pix_Table 的 cache 功能

disableCache(mixed $group) : void

static
access public

Parameters

$group

mixed

disableLog 停用某個 LOG

disableLog(mixed $group) : void

static
access public

Parameters

$group

mixed

disableTableCache 停用 Table Cache

disableTableCache() : void

access public

dropTable 刪除這個 table

dropTable() : void

static
access public

enableCache 開啟 Pix_Table 的 cache 功能

enableCache(mixed $group) : void

static
access public

Parameters

$group

mixed

enableLog 啟用某個 LOG

enableLog(mixed $group) : void

static
access public

Parameters

$group

mixed

enableTableCache 啟用 Table Cache

enableTableCache($cache_prefix) : void

access public

Parameters

$cache_prefix

find 透過 $primary_value 這個 pk 取得一筆 row

find(mixed $primary_value) : \Pix_Table_Row | null

static
access public

Parameters

$primary_value

mixed

Returns

findUniqueKey 尋找這要用哪一個 Unique Key

findUniqueKey(array $columns) : string | null

static
access public

Parameters

$columns

array

有哪些 column

Returns

stringnull哪一組 index

find_by()

find_by($columns, $values) 

Parameters

$columns

$values

getCache()

getCache() 

getCacheStatus 取得某個 group 的 cache 功能是開是關

getCacheStatus(string $group) : void

static
access public

Parameters

$group

string

getClass 回傳這個 table 的 class name

getClass() : void

access public

取得該 Table 專用的 Pix_Table_Db

getDb() : \Pix_Table_Db

Returns

getDefaultDb 取得預設的 Db

getDefaultDb() : void

static
access public

getFilters()

getFilters() 

getForceMaster 取得是否要強制從 master 抓資料的設定

getForceMaster() : boolean

static
access public

Returns

boolean

getHelperManager get Pix_Helper_Manager from this table

getHelperManager(string $type) : \Pix_Helper_Manager

access public

Parameters

$type

string

Returns

getIndexColumns()

getIndexColumns($name) 

Parameters

$name

getIndexes get Table index list

getIndexes() : array

static
access public

Returns

array

getLogStatus 取得某個 log 的狀態

getLogStatus(mixed $group) : void

static
access public

Parameters

$group

mixed

getLongQueryTime 取得 Slow query 的設定秒數

getLongQueryTime() : 

static
access public

Returns

getPrimaryColumns()

getPrimaryColumns() 

getQueryComment 取得要在 db 下 query 時所加上的註解

getQueryComment() : null | string

static
access public

Returns

nullstring

getRelationForeignKeys 取得某個 relation 的 relation name

getRelationForeignKeys(string $relation) : array

static
access public

Parameters

$relation

string

relation 名稱

Returns

arrayrelation 的 columns

getRelationForeignTable 取得 relation 對應的 table

getRelationForeignTable(string $relation) : \Pix_Table

static
access public

Parameters

$relation

string

relation 名稱

Returns

\Pix_Table對應的 table

getRowFromCache 從 Cache 中取得 Row

getRowFromCache(array $primary_values) : false

access public

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

static
access public

Parameters

$type

string

Returns

getTable()

getTable($table) 

Parameters

$table

getTableName 取得 Table 名稱

getTableName() : string

static
access public

Returns

string

init 第一次 load table 進來要做的事,替代掉 __contstruct

init() : void

access public

insert 新增一筆資料進資料庫(立刻會存進資料庫)

insert(mixed $data) : void

static
access public

Parameters

$data

mixed

isEditableKey 是否是可以被修改的 Row Key, Ex: column, relation ...

isEditableKey(string $key) : boolean

static
access public

Parameters

$key

string

Returns

boolean

isNumbericColumn 回傳現在這個 column 是不是只有數字

isNumbericColumn(string $column) : boolean

access public

Parameters

$column

string

column name

Returns

boolean

is_a $object 是否是 $table 類型的 Row

is_a(\Pix_Table_Row $object, string $table) : boolean

static
access public

Parameters

$object

\Pix_Table_Row

$table

string

Returns

boolean

declare a new empty Pix Table

newEmptyTable($table_name) : \Pix_Table

static
access public

Parameters

$table_name

Returns

setCache()

setCache($cache) 

Parameters

$cache

setClassName()

setClassName($name) 

Parameters

$name

setDb()

setDb($db) 

Parameters

$db

setDefaultDb 指定 Pix_Table 預設的 db

setDefaultDb(\Pix_Table_Db $db) : void

static
access public

Parameters

$db

\Pix_Table_Db

用哪個 db

setForceMaster 設定要不要強制從 master 抓資料。

setForceMaster(mixed $enable) : void

static
access public

Parameters

$enable

mixed

setLongQueryTime 當 Query 時間超過這個時間時,會噴出 Warning log

setLongQueryTime(int $second) : void

static
access public

Parameters

$second

int

setQueryComment 在 Db 下 Query 時,自動加上註解

setQueryComment(\null/string $comment) : void

static
access public

Parameters

$comment

\null/string

 Properties

 

_aliases 建立 relation 的 aliases

$_aliases : array

access public
 

記錄哪些東西要 Cache

$_cache_groups 

 

$_cache_rows

$_cache_rows 

 

_columns 這個 Table 有哪些 column

$_columns : array

access public
 

$_force_master

$_force_master 

 

_hooks 這個 Table 有哪些 hook

$_hooks : array

access public
 

_indexes 該 Table 用到的 index

$_indexes : array

deprecated use Table->addIndex instead
access public
 

記錄哪些東西要 Log

$_log_groups 

 

_name 這個 Table 在 Db 上面的名稱是什麼

$_name : string

access public
 

_primary Primary key, 可以是

$_primary : string | array

access public
 

_relations 這個 Table 有哪些 relation

$_relations : array

access public
 

_resultSetClass 這個 Table 的 ResultSet class

$_resultSetClass : string

access public
 

_rowClass 這個 Table 的 Row class

$_rowClass : string

access public
 

$_save_memory

$_save_memory 

 

$_verify

$_verify 

 Constants

 

CACHE_ALL

CACHE_ALL 

 

CACHE_FIND

CACHE_FIND 

 

LOG_ARRAYCACHE

LOG_ARRAYCACHE 

 

LOG_CACHE

LOG_CACHE 

 

LOG_QUERY

LOG_QUERY 

 

LOG_SLOWQUERY

LOG_SLOWQUERY