我想知道是否有使用 doctrine 的神奇方法来查找空值的方法。例如:
Doctrine::getTable('myClass')->findByDeletedAt(null);
本质上,我想返回所有没有被删除的记录。我试过上面的方法,但似乎不起作用。
有什么想法吗?
最佳答案
尝试这个给了我错误:
Catchable fatal error: Argument 1 passed to Doctrine\ORM\EntityRepository::findBy() must be an array, string given
所以这对我有用:
$repository->findBy(array('date_field' => null));
关于php - Doctrine 通过魔法查找空值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3868590/