メインコンテンツまでスキップ
Version: Fegg 5.x(開発版)

Model::whereNotNull

Match rows where a column is not NULL

Description​

public self Model::whereNotNull( string $column, [ string $andOr = 'AND' ] )

Adds column IS NOT NULL. Throws InvalidArgumentException when $column is not a plain name.

Arguments​

NameData typeDefaultRemarks
$columnstringColumn name
$andOrstring'AND'How it joins the previous condition: AND or OR

Example​

Controller
$model = new Model(false, array(
'table' => 'cms_news',
'id' => 'news_id',
'visible' => 'visible',
));

// ... Where image_id IS NOT NULL AND ...
$records = $model->whereNotNull('image_id')->find();