Re: [symfony-users] Required fields on create/update

2011-06-20 Thread Ваня Масич
Thanks you *Matías Roldán*, but i forget say that question on symfony2.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Required fields on create/update

2011-06-17 Thread Matías Roldán

Something like this:

if($this-isNew())
{
$this-validatorSchema['password']-setOption(required, true);
}
else
{
$this-validatorSchema['password']-setOption(required, true);
}

Or in one line:

$this-validatorSchema['password']-setOption(required, ($this-isNew());

How I can make required field validation only for create, and disable
it on update, for example when user register, field password should
not be null, but on update it should not be null only if user whant
update password?



--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en