Alter the conditions in a DatabaseCondition object
You can grab the conditions array for the full query like this:

$conditions =&amp; $query-&gt;conditions();


As you're getting the array by reference any changes you make to it (and the conditions within) will be reflected back on the query object before it's executed.

If you want to replace all of the conditions in the query you can simply overwrite that array with a new one (filled with conditions obviously).

It might be safer, though, to loop through the conditions array and remove/alter only the conditions that you need to change. This will make sure that conditions added by other modules will still get their chance to be included in the query.

Editing an existing condition is tricky (I haven't managed to get it to work yet though I haven't tried very hard!). I think your best bet is to rebuild the conditions you need to change from scratch and replace them rather than try to edit them directly.