Hi created a custom model inside Magento(resource is based on Mage_Core_Model_Resource_Db_Collection_Abstract ). Everything works pretty much fine.
I tried to make a filter on table, that would output the following where clause:
where
product_id = 1
and ((customer_id = 0 and customergroup_id = 2) or (customergroup_id = 0 and customer_id = 3))
and ((productgroup_id = 0 and product_class = 8) or (product_class = 0 and productgroup_id = 4))
Any idea on how to do that using addFilter or something?
The
addFieldToFilter/addAttributeToFiltermethods are not well suited for a query that complex. You will have to construct your query by hand: