Model::whereNull
カラムがNULLの行に絞り込みます
説明
public self Model::whereNull( string $column, [ string $andOr = 'AND' ] )
column IS NULLを追加します。$columnが単純な名前でない場合はInvalidArgumentExceptionを投げます。
引数
| 名前 | データ型 | デフォルト | 備考 |
|---|---|---|---|
| $column | string | カラム名 | |
| $andOr | string | 'AND' | 前の条件とのつなぎ方(ANDまたはOR) |
例
Controller
$model = new Model(false, array(
'table' => 'cms_news',
'id' => 'news_id',
'visible' => 'visible',
));
// ... Where image_id IS NULL AND ...
$records = $model->whereNull('image_id')->find();