Tuesday, July 31, 2012

Selecting hasMany fields

I have an Order that hasMany LineItems.  I only want to extract an Order if certain LineItems.fields meet my conditions.

I'm using

$this->Order->find('list', array(
                'conditions' => array('LineItem.event_id' => '3',
                                      'LineItem.pulled' => '1'),
        //        'order' => array(Order.id => 'asc'),
                'recursive' => '2'
        ));

However all I get is ALL Orders.

Any ideas, thanks
Brian

--
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: