Where you set Profile fields include 'Profile.user_id'.

On Nov 21, 5:47 am, Dave <make.cake.b...@gmail.com> wrote:
> Wondering why when I specify fields in this contain for User I cant
> get and of the related Profile fields?
>
> If i remove 'fields' from the User it pulls all User fields and then I
> get my Profile fields but I dont want all my User fields, just the few
> i need. What am I doing wrong here?
>
> public function getUser($auth_id)
>         //this fetches basic info for the profile view/index
>         {
>                 $params = array(
>                'conditions' => array(
>                                 'User.id' => $auth_id),
>                         'fields' => array(
>                                 'User.firstname',
>                                 'User.lastname',
>                                 'User.username',
>                                 'User.email',
>                                 'User.slug',
>                                 'User.id',
>                                 'User.reset',
>                                 'User.confirm_code'),
>                         'contain' => array(
>                                 'Profile' => array(
>                                         'fields' => array(
>                                                 'Profile.id',
>                                                 'Profile.email'))));
>
>                 $q = $this->find('first', $params);
>               return $q;
>         }

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@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=.


Reply via email to