Re: Using Model in Custom Component

2008-12-10 Thread jjh

A... stupid me! Thanks a lot!

On Dec 10, 12:53 am, grigri <[EMAIL PROTECTED]> wrote:
> You've written "condition" where it should be "conditions"
>
> On Dec 10, 8:47 am, jjh <[EMAIL PROTECTED]> wrote:
>
> > I had to setup a find query inside my custom component but the find
> > method doesn't seem to like my conditions array. Can anyone tell me
> > what's wrong?
>
> >    public function test($id) {
> >       $userInstance = ClassRegistry::init('User');
> >       $param = array(
> >          'condition' => array("User.id"=>$id),
> >          'recursive' => -1
> >       );
> >       $user = $userInstance->find('all',$param);
> >       print_r($user);exit;
> >    }
>
> > The result is always the entire data set.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using Model in Custom Component

2008-12-10 Thread grigri

You've written "condition" where it should be "conditions"

On Dec 10, 8:47 am, jjh <[EMAIL PROTECTED]> wrote:
> I had to setup a find query inside my custom component but the find
> method doesn't seem to like my conditions array. Can anyone tell me
> what's wrong?
>
>    public function test($id) {
>       $userInstance = ClassRegistry::init('User');
>       $param = array(
>          'condition' => array("User.id"=>$id),
>          'recursive' => -1
>       );
>       $user = $userInstance->find('all',$param);
>       print_r($user);exit;
>    }
>
> The result is always the entire data set.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Using Model in Custom Component

2008-12-10 Thread jjh

I had to setup a find query inside my custom component but the find
method doesn't seem to like my conditions array. Can anyone tell me
what's wrong?

   public function test($id) {
  $userInstance = ClassRegistry::init('User');
  $param = array(
 'condition' => array("User.id"=>$id),
 'recursive' => -1
  );
  $user = $userInstance->find('all',$param);
  print_r($user);exit;
   }

The result is always the entire data set.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---