i think there might have been some syntax errors so i fixed it as
follows, however it is still not working. any help?
function beforeValidate() {
// for add -there is no id
if (!isset($this->data['User']['id']) && !empty($this-
>data['User']['name'])
&& $this->hasAny("User.name=$this->data['User']['name']"))
{
$this->invalidate('name_unique');
}
// for edit - there is id
if (isset($this->data['User']['id']) && !empty($this-
>data['User']['name'])
&& $this->findCount("User.name = $this->data['User']
['name']")) {
$this->invalidate('name_unique');
}
return true;
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---