getCriteria not working as expected with boolean field types I have a custom content table for an elementType. I have a few fields set up in my Record as boolean. The two fields are approved and denied I have to search the database where both fields are set to zero/false.

I can only get the values to show up in $query-&gt;params inside my modifyElementsQuery() method when I set $criteria-&gt;approved/denied to (string)"1". Setting these to true, false, or (string)"0" cause them to not show up in the $query-&gt;params list.

How do I work with a boolean field in this manner? I need Where denied = '0' to show up in the query when i set $criteria-&gt;denied = false
I believe this should work (not tested):

$criteria-&gt;setAttribute('denied', 'not 1');


As when using the ElementCriteriaModel in Twig, you can't directly check for "falsey" values.