/** */ public function validate(ExecutionContextInterface $context) { if ($this->getStartDate() >= $this->getEndDate()) { $context->addViolationAtPath('startDate', 'Start Date must be less than end date'); } $today = new \DateTime(); if ($this->getStartDate() < $today) { $context->addViolationAtPath('startDate', 'Start Date cannot be in the past.'); } }
/** */ public function validate(ExecutionContextInterface $context) { if ($this->getStartDate() >= $this->getEndDate()) { $context->addViolationAtPath('startDate', 'Start Date must be less than end date'); } }