Kiril Angov wrote:

> I like the third version. If you return an error object then there can 
> be a static method like the PEAR::isError() where you pass wth return to 
> chech if validation succeeded or not and then take the errors with 
> $e->getErrors() or something like this.

Well I always loved PEAR_Error. One cool aspect if PEAR_Error was that 
you had some say in the severity of errors triggered. For example you 
could define a global callback would receive any PEAR_Error instance 
created. In that you could trigger an SMS to a sys admin for some or 
kind of ignore others.

Now if we combine this with the power of exceptions, one could define a 
callback that could optionally fire exceptions (for certain error codes) 
and just let others pass or whatever. Hmm actually I guess this doesnt 
really make sense for a validation system .. so ignore ..

The key thing is that a single validator shoulod have the ability to 
return multiple errors by storing them inside the exception or whatever 
other structure we return. This obviously does not work when using 
"return false".

regards,
Lukas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" 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-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to