I'm wondering if there is anyway to use doctrine's magic method to look for null values. For instance:
Doctrine::getTable('myClass')->findByDeletedAt(null);
Essentially, I want to return all records that are not deleted. I've tried the above, but it doesn't seem to work.
Any ideas?
Trying this gives me the error:
Catchable fatal error: Argument 1 passed to Doctrine\ORM\EntityRepository::findBy() must be an array, string given
So this works for me:
$repository->findBy(array('date_field' => null));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With