getBegin(); $end = $value->getEnd(); // this case is handled in TimesheetValidator and should not raise a second validation if ($begin !== null && $end !== null && $begin > $end) { return; } if ($this->configuration->isTimesheetAllowOverlappingRecords()) { return; } if (!$this->repository->hasRecordForTime($value)) { return; } $this->context->buildViolation('You already have an entry for this time.') ->atPath('begin_date') ->setTranslationDomain('validators') ->setCode(TimesheetOverlapping::RECORD_OVERLAPPING) ->addViolation(); } }