In your form class you'll need something like:
public function configure() {
parent::configure();
// Common Validation
if ($this->isNew) {
// extra validation for new objects
} else {
// extra validation for existing objects
}
}
On Fri, 2009-10-30 at 03:44 -0700, ravi wrote:
> Hello everyone,
>
> I am using sfValidatorDoctrineUnique to validate unique username and
> i am going to implement to edit the "username". so at the time when
> form comes to edit the user and if i will not change the username then
> also it gives me the error for uniquenes.. if any one know how to skip
> a single record for sfValidatorDoctrineUnique while editing the form.
> for example..
> user:- ravi
> pass:- ravi
>
> and if am going to edit the user then without changing username if
> press save button then it will validate the the value "ravi" with my
> own value "ravi" and throws error.. so is there any way to compare the
> newly updated record with all records except the "edited one.."...
>
> thanx in advance..
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---