src/DcSiteBundle/Controller/Infiniti/ServiceController.php line 42

Open in your IDE?
  1. <?php
  2. namespace DcSiteBundle\Controller\Infiniti;
  3. use CoreBundle\Component\CoreFormFactory;
  4. use CoreBundle\Component\FormManager;
  5. use CoreBundle\Entity\Model;
  6. use CoreBundle\Factory\Vehicle as VehicleFactory;
  7. use CoreBundle\Model\Api\OnlineService\ApiServer1C;
  8. use CoreBundle\Model\Vehicles\Repository;
  9. use CoreBundle\Services\MediaExtensionVidi;
  10. use DcSiteBundle\Model\Form\ServicesOrderForm;
  11. use DcSiteBundle\Services\VehicleService;
  12. use Doctrine\ORM\EntityManagerInterface;
  13. use PortalBundle\Model\SeoMetaTag;
  14. use Symfony\Component\Filesystem\Filesystem;
  15. use Symfony\Component\HttpFoundation\Request;
  16. use Symfony\Component\HttpFoundation\RequestStack;
  17. use Symfony\Component\HttpFoundation\Response;
  18. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  19. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  20. use Symfony\Component\Routing\RouterInterface;
  21. use Twig\Environment;
  22. class ServiceController extends MainController
  23. {
  24.     public function __construct(CoreFormFactory $coreFormFactorySeoMetaTag $seoMetaTagRequestStack $requestStackRouterInterface $routerFormManager $formManagerEntityManagerInterface $emApiServer1C $apiServer1CSessionInterface $sessionFilesystem $filesystemMediaExtensionVidi $mediaExtensionVidiRepository $vehicleRepositoryVehicleFactory $vehicleFactoryEnvironment $twig)
  25.     {
  26.         parent::__construct($coreFormFactory$seoMetaTag$requestStack$router$formManager$em$apiServer1C$session$filesystem$mediaExtensionVidi$vehicleRepository$vehicleFactory$twig);
  27.     }
  28.     public function serviceWarranty(): ?Response
  29.     {
  30.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/service_warranty.html.twig');
  31.     }
  32.     public function support(): ?Response
  33.     {
  34.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/support.html.twig');
  35.     }
  36.     public function indexService(Request $request): ?Response
  37.     {
  38.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/order-to.html.twig', [
  39.             'serviceForm' => $this->CoreFormFactory()->serviceForm()->createView(),
  40.             'dealerName' => $this->getDealer()->getBrand()->getName()
  41.         ]);
  42.     }
  43.     public function regulationsTo(VehicleService $vehicleService): ?Response
  44.     {
  45.         $models $vehicleService->getModelsForRegulationsTo($this->getDealer());
  46.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/regulations-to.html.twig', [
  47.             'models' => $models,
  48.         ]);
  49.     }
  50.     public function regulationsToModel($model): ?Response
  51.     {
  52.         $model $this->em->getRepository(Model::class)->findOneBy(['url' => $model]);
  53.         if (!$model) {
  54.             throw new NotFoundHttpException();
  55.         }
  56.         return $this->baseInfinitiRender'@DcSite/Infiniti/Service/regulations-to-model.html.twig',[
  57.             'model' => $model->getId(),
  58.             'modelTitle' => $model->getTitle(),
  59.         ]);
  60.     }
  61.     public function bodyRepair(): ?Response
  62.     {
  63.         $repairPhotoForm $this->CoreFormFactory()->repairPhotoForm();
  64.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/body-repair.html.twig',[
  65.             'repairPhotoForm' => $repairPhotoForm->createView(),
  66.         ]);
  67.     }
  68.     public function serviceTiresHotel(): ?Response
  69.     {
  70.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/tires-hotel.html.twig', [
  71.             'serviceOrderForm' => $this->CoreFormFactory()->servicesOrderForm(ServicesOrderForm::TIRE_HOTEL)->createView(),
  72.         ]);
  73.     }
  74.     public function extendedWarranty(): ?Response
  75.     {
  76.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/extended-warranty.html.twig',[
  77.             'servicesForm' => $this->CoreFormFactory()->extendedWarrantyForm(null$this->getDealer())->createView(),
  78.         ]);
  79.     }
  80.     public function multiConsultationEnter(): ?Response
  81.     {
  82.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/consultation.html.twig');
  83.     }
  84.     public function multiConsultationForm(): ?Response
  85.     {
  86.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/consultation-form.html.twig');
  87.     }
  88.     public function multiConsultationFormOnline(): ?Response
  89.     {
  90.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/consultation-form-online.html.twig');
  91.     }
  92.     public function multiConsultationTestdriveForm(): ?Response
  93.     {
  94.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/consultation-testdrive-form.html.twig');
  95.     }
  96.     public function nightServiceAgreement(): ?Response
  97.     {
  98.         return $this->baseInfinitiRender('@DcSite/Infiniti/Service/night-service-agreement.html.twig', [
  99.             'dealer' => $this->getDealer()
  100.         ]);
  101.     }
  102. }