1

I am trying to use findFirst() to load models by NULL value of field:

$model = MyModel::findFirst([
    'conditions' => 'field=?0',
    'bind' => [
        0 => null,
    ],
    'bindTypes' => [
        0 => Phalcon\Db\Column::BIND_PARAM_NULL,
    ]
]);

This does not find the row whose field value is NULL.

Question:

How do I use findFirst to load models by NULL value of a field?

Thanks!

1 Answer 1

2

This is what I would personally do

$model = MyModel::findFirst(['field is null']);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.