How to specify null value as filter in a Doctrine query?

后端 未结 2 1862
感动是毒
感动是毒 2021-02-02 05:08

I am using Doctrine 1.1 in Zend. I am trying to write a query that will return records that have a null value in a certain column.

    $q = Doctrine_Query::creat         


        
2条回答
  •  难免孤独
    2021-02-02 05:23

    If you are using Symfony 2 and above, you can use this code:

    ->where($qb->expr()->isNull('a.vertical_id'));
    

    Reference:
    http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/query-builder.html#the-expr-class

提交回复
热议问题