$this->findBy* from the User model
you can access the associated model using $this->AssociatedModel-
>find...

you should stick most of the model/query stuff inside models (fat
models, thin controllers)

loading models is an option but it really depends on the situation -
generally you shouldnt load models in other models but its possible so
there are situation when its necessary.

On Dec 15, 6:45 am, oracle411 <[EMAIL PROTECTED]> wrote:
> Hi Guys,
>
> I currently validating from my controllers using Model findBy*
> methods.  Usually using many different model queries inside one
> controller.  Something like this:
>
> //get user object
> $results = $this->User->findByEmail($this->data['User']['email']);
> if ($results && $results['User']['password'] == md5($this->data['User']
> ['password'])) {
>
> I want to start using cake 1.2 validation methods, where we stick most
> of our validation inside our Model objects.  Their we can define
> custom rules to use for validation.  My question is how do I use
>                               $this->User->findByEmail
> type of methods inside the model itself and using other models inside
> models?  Is their a way to do this or do I just keep using my
> controller to validation certain things.
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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