Hypothetical situation. I want to populate/load a sales/order collection with every order where the grand_total is equal to the total_paid. I know I can use addFieldToFilter to filter by a specific value, but is it possible to use this method to filter by other database values. If not, is there any data access object in the Magento system that allows this.
$orders = Mage::getModel('sales/order');
$orders = $orders->getCollection();
$orders->addFieldToFilter('total_paid',Array('eq'=>30)); //would find all the orders that were 30
//syntax to find all the orders whose total_paid value is equal to it's grand_total attribute
The non-eav SQL concept I’m grasping for is
SELECT * FROM Orders o WHERE o.total_paid = o.grand_total
Is this possible to do purely with object method calls, or do I need to do post-load filtering?