getAccompanyingPeriodWork(); if (!$this->security->isGranted(AccompanyingPeriodWorkVoter::UPDATE, $work)) { throw new AccessDeniedHttpException('not allowed to edit this accompanying period work'); } $document->setAccompanyingPeriodWorkEvaluation($evaluation); $this->entityManager->persist($document); $this->entityManager->flush(); return new JsonResponse( $this->serializer->serialize($document, 'json', [AbstractNormalizer::GROUPS => ['read']]), json: true ); } }