source/View/Controller/ReviewController.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\View\Controller;
  3. use App\Domain\Model\Study\Experiment;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  5. use Symfony\Component\HttpFoundation\Request;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. /**
  9.  * @IsGranted("ROLE_USER")
  10.  */
  11. class ReviewController extends DataWizController
  12. {
  13.     /**
  14.      * @Route("review/{uuid}", name="Study-review")
  15.      *
  16.      * @param string $uuid
  17.      * @param Request $request
  18.      * @return Response
  19.      */
  20.     public function reviewAction(string $uuidRequest $request): Response
  21.     {
  22.         $entityAtChange $this->getEntityAtChange($uuid);
  23.         return $this->render('Pages/Review/index.html.twig', [
  24.             'experiment' => $this->getEntityAtChange($uuid),
  25.             'experimentName' => $entityAtChange->getSettingsMetaDataGroup()->getShortName(),
  26.             'basicInfoReview' => $entityAtChange->getBasicInformationMetaDataGroup()->getReviewCollection(),
  27.             'basicCreatorInfoReview' => $entityAtChange->getBasicInformationMetaDataGroup()->getCreators(),
  28.             'theoryReview' => $entityAtChange->getTheoryMetaDataGroup()->getReviewCollection(),
  29.             'methodReview' => $entityAtChange->getMethodMetaDataGroup()->getReviewCollection(),
  30.             'measureReview' => $entityAtChange->getMeasureMetaDataGroup()->getReviewCollection(),
  31.             'sampleReview' => $entityAtChange->getSampleMetaDataGroup()->getReviewCollection(),
  32.         ]);
  33.     }
  34.     protected function getEntityAtChange(string $uuidstring $className Experiment::class): Experiment
  35.     {
  36.         return $this->crud->readById($className$uuid);
  37.     }
  38. }