getEnd()) { return; } if ($this->context->getViolations()->count() > 0) { return; } if (null !== $this->security->getUser() && $this->security->isGranted('start', $value)) { return; } $mode = $this->trackingModeService->getActiveMode(); $path = 'start_date'; if ($mode->canEditEnd()) { $path = 'end_date'; } elseif ($mode->canEditDuration()) { $path = 'duration'; } $this->context->buildViolation('You are not allowed to start this timesheet record.') ->atPath($path) ->setTranslationDomain('validators') ->setCode(TimesheetRestart::START_DISALLOWED) ->addViolation(); } }