On 4/30/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote:
> I wanted the unique check only on users/register. But, it rather
> checks on every User->validates() and User->save() call. I thought of
> filtering the check inside beforeValidate() by checking the action,

If your users/register is equivalent of add you can check if $this->id
is set or not in beforeValidate() if id is set then do not
validate....

Similarly if id is set then check for id != !this->id - to give an
example if you want the username to be unique - then in add you just
check if username is unique while adding however while editing you
will have to exclude $this->id

Hope that makes sense :)

Cheers
Tarique

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to