I believe I spoke to you in the IRC channel, but the simplest method
of achieving what you want is to define a method on your domain
object:

/**
 * @assert:True(message="Some time constraint is bad")
 */
public function isTimeValid() { return $this->time_a < $this->time_b; }


t

On Tue, May 3, 2011 at 09:04, Greg Militello <g...@thinkof.net> wrote:
> Hey all,
> I am not seeing a good way to use the annotation system in my case:
> I am storing 2 times (however I could easily see storing two values of ANY
> type), and I need to ensure that time_a is less than or equal to time_b.
> To be more specific, I am planning to store a time range.  For reporting
> purposes the in time can never be passed the out time.
> I tried using the Valid validation constraint type, however my efforts
> failed.  Was I on the correct track, but just not successful?
> Perhaps this case is not so uncommon that a "Comparison" validation
> constraint would be beneficial (I could see this getting complicate quickly
> but I do not see an obvious solution as-is either)?
> -Greg
>
> --
> 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
>

-- 
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

Reply via email to