I'd like to add an Assert\Expression to a property of my entity. There should be an error message popping up, when the selected "Effective date" (this.getEffective()) is in the past or today. I just can't figure out, how to compare that date with todays date.
/**
* @var boolean
* @ORM\Column(type="boolean", nullable=true)
* @Assert\Expression(
* "this.getEffective() > today",
* message="The effective date must be in the future!")
*/
private $status_stealth;
I tried the same with now or datetime.now() and I've google around a lot, but I haven't found anything where somebody actually compared another value with the current date within an Assert Expression.
Ideas?