CakePHP, wrting a better query string

rampBrierrirm

New Member
In Cakephp is there a better way to write this:\[code\]$unread_orders = $this->Order->find('all', array('conditions' => array('Order.status' => 'unread') ));$read_orders = $this->Order->find('all', array('conditions' => array('Order.status' => 'read') ));$dispatched = $this->Order->find('all', array('conditions' => array('Order.status' => 'dispatched'), 'limit' => 5));$canceled = $this->Order->find('all', array('conditions' => array('Order.status' => 'canceled'), 'limit' => 5));\[/code\]There is a limit on the dispatched and canceled items.It's seems like there would be a more effcient way of doing this, in one call to the database instead of 4.Cheers.
 
Back
Top