Skip to main content
Version: Fegg 5.x (next)

Model::whereNull

Match rows where a column is NULL

Description​

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

Adds column IS 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 NULL AND ...
$records = $model->whereNull('image_id')->find();