which ensures updates are left as-is.
if (!empty($this->id)) {
$fields[$this->alias . '.' . $this->primaryKey . ' !='] = $this-
>id;
}
Cheers,
Adam
On Dec 1, 5:30 pm, AngeloZanetti <angelo...@gmail.com> wrote:
> I have got a similiar problem that the validation works for adding must it
> mustn't validate when editing the record as its going to have the same name
> in DB as the form when editing.
>
> how can we disable this for the edit function? or must it be done in the
> controller?
>
> jonknee wrote:
>
> >> In fact, it seems that this built-in rule doesn't work!
> >> Why is this not yet fixed? We allways need to check unicity of a field
> >> in all of our applications...
>
> > What's not working for you? It seems to be working for me. I had a
> > custom method until I was told about isUnique working through
> > validation and after updating my code it seemed to keep working.
>
> --
> View this message in context:http://www.nabble.com/Check-Unique-in-a-model-tp16473557p20767209.html
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment