I would like to use addFieldToFilter (or other...) in a collection to make this filter :
(item1 = 'value' AND (item2 = 'value1' OR item = 'value2')) OR (item2 = 'value3' OR item = 'value4')
Whenever dealing with complex filters, I prefer to work with the underlying Zend_Db_Select
object. For example:
$collection
->getSelect()
->where(
new Zend_Db_Expr("(item1 = '?' AND (item2 = '?' OR item = '?')) OR (item2 = '?' OR item = '?')"),
'value1',
'value2',
'value3',
'value4'
);