I have a collection that I have to filter according to multiple strings in one field. The trick is that one of the possible values in that field needs to be picked only if another field's value meets a certain condition. For example:
$this->addFieldToFilter(
'my_field1',
array(
'val1', |
'val2', | <--- This is the OR part
'val3', |
'val4 AND my_field2 like 'my_field2_val' // <-- This is the tricky part
)
);
Can any of you guys help me? PS: My collection is a flat one not EAV.
array('eq'=>'val1')it should be just'eq'=>'val1'. – Marius Oct 20 '14 at 14:01$collection->getSelect()->doWhateverYouWantWithThisZend_Db_SelectObject– Fabian Blechschmidt Oct 20 '14 at 14:25