cake-php@googlegroups.com
[Top] [All Lists]

Re: Models problem

Subject: Re: Models problem
From: Tilen Majerle
Date: Mon, 20 Sep 2010 21:36:57 +0200
emm...before u call $this->ModelName->validates() you need to set the data for validation...so do something like this:

{{{

$this->ModelName->set($this->data);
$validate = $this->ModelName->validates(); //will return true or false

}}}

and if u have something like that with associated models maybe....then do this

{{{

$this->ModelName->ModelName2->set($this->data);
$validate = $this->ModelName->ModelName2->validates(); //will return true or false and only check data for ModelName2

}}}

--
Tilen Majerle


2010/9/19 newbie <lunet1011@xxxxxxxxx>
Hi. I was trying to debug an issue where whenever I perform $this-
>ModelName->Validates(), it always returns true. However, I discovered
that if I deleted all the files in the Model folder, I didn't get any
errors. I was able to save queries to the database, regardless. What
is wrong? Is this expected?

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@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

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@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
<Prev in Thread] Current Thread [Next in Thread>