メインコンテンツまでスキップ
Version: Fegg 5.x

Model::pragma

テーブルにSQLiteのPRAGMAを実行します

説明​

public array Model::pragma( string $mode )

モデルのテーブルに対してSQLiteのPRAGMAを実行し、結果の行を返します。SQLite専用です。

引数​

名前データ型デフォルト備考
$modestringPRAGMAのモード

PRAGMAのモード​

モードクエリ
tablePRAGMA table_info("table")(不明なモードもこれになります)
index_listPRAGMA index_list("table")
indexPRAGMA index_info("table")

例​

Controller
$model = new Model(true, array(
'table' => 'cms_news',
));

// PRAGMA table_info("cms_news")
$columns = $model->pragma('table');

print_r($columns[0]);
Output
Array
(
[cid] => 0
[name] => news_id
[type] => INTEGER
[notnull] => 1
[dflt_value] =>
[pk] => 1
)