Haha I feel like an idiot. My next query is grabbing all the cards related to a profile id, since those do not have profile_id in the table, so I would have to attach Cardset, but still do not want to include the data from Cardset in the query
On Jan 8, 2:22 am, John Andersen <j.andersen...@gmail.com> wrote: > Don't include Profile in your contain, just make a condition straight > on Cardset.profile_id! > > [code snippet]> 'contain' => false, > > 'conditions' => array( > > 'Cardset.profile_id' => $profileId['Profile']['id'] > > ), > > 'fields' => array('id') > > [/code snippet] > > Enjoy, > John > > On Jan 8, 6:31 am, trobrock <trobr...@gmail.com> wrote: > > > > > I have some models set up with the following relations: > > > Profile->Cardset->Card > > > I am trying to get all the Cardsets related to a specific Profile Id > > and am using this: > > > $cardsets = $this->Cardset->find('all', array( > > 'contain' => array( > > 'Profile' => array( > > 'conditions' => array( > > 'Profile.id' => $profileId['Profile']['id'] > > ), > > 'fields' => array('id') > > ) > > ) > > )); > > > The problem with this is it returns $cardsets[n]['Profile']['id'] the > > only data I want returned is the Cardset Model data and no Profile > > data, what is the best way of achieving this?
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en