Something like:
$this-> Customer ->find('all', array(
'conditions' => array(
'Customer.id' => 1
),
'contain' => array(
'Invoice' => array(
'order' => 'Invoice.created DESC',
'limit' => 2
),
'Credit' => array(
'conditions' => array('Credit.active' => true)
)
)
));
This should fetch the customer info and include that customer's last 2 invoices and all active credits.
-- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment