I have this:
 
User Model
 
$q = $this->find('first', array(
      'conditions' => array(
       'User.id' => $auth_id),
      //'fields' => array('User.id'),
      'contain' => array(
       'Addition' => array(
        'conditions' => array('Addition.id' => $auth_id),
        'fields' => array(
         'Addition.id',
         'Addition.a'.$field)),
       $skill => array(
        'fields' => array(
         $skill.'.name')))));
   debug($q);
    }
 
User hasOne Addition related by id
 
If I use 'fields' => array('User.id'), in the user no Addition shows up at
all
 
Remove the 'fields' => array('User.id'), and Addition shows up in the array
but all the User fields show up, User has a load of info I dont need, hence
the fact im using contain. I only want the Addition related to the User
 
Ideas where this is going wrong?
 
Dave 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to