src/DcSiteBundle/Controller/Nissan/ServiceController.php line 63

Open in your IDE?
  1. <?php
  2. namespace DcSiteBundle\Controller\Nissan;
  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\RequestStack;
  16. use Symfony\Component\HttpFoundation\Response;
  17. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  18. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  19. use Symfony\Component\Routing\RouterInterface;
  20. use Twig\Environment;
  21. class ServiceController extends BaseController
  22. {
  23.     public function __construct(CoreFormFactory $coreFormFactorySeoMetaTag $seoMetaTagRequestStack $requestStackRouterInterface $routerFormManager $formManagerEntityManagerInterface $emApiServer1C $apiServer1CSessionInterface $sessionFilesystem $filesystemMediaExtensionVidi $mediaExtensionVidiRepository $vehicleRepositoryVehicleFactory $vehicleFactoryEnvironment $twig)
  24.     {
  25.         parent::__construct($coreFormFactory$seoMetaTag$requestStack$router$formManager$em$apiServer1C$session$filesystem$mediaExtensionVidi$vehicleRepository$vehicleFactory$twig);
  26.     }
  27.     public function accessories(): ?Response
  28.     {
  29.         return $this->baseNissanRender('@DcSite/Nissan/Service/accessories.html.twig', [
  30.             'spareForm' => $this->CoreFormFactory()->buySparePartsForm($this->getDealer())->createView(),
  31.         ]);
  32.     }
  33.     public function bodyService(): ?Response
  34.     {
  35.         $repairPhotoForm $this->CoreFormFactory()->repairPhotoForm();
  36.         return $this->baseNissanRender('@DcSite/Nissan/Service/body-service.html.twig', [
  37.             'repairPhotoForm' => $repairPhotoForm->createView(),
  38.         ]);
  39.     }
  40.     public function guarantee(): ?Response
  41.     {
  42.         return $this->baseNissanRender('@DcSite/Nissan/Service/guarantee.html.twig');
  43.     }
  44.     public function interactive(): ?Response
  45.     {
  46.         return $this->baseNissanRender('@DcSite/Nissan/Service/interactive-acceptance.html.twig');
  47.     }
  48.     public function painting(): ?Response
  49.     {
  50.         return $this->baseNissanRender('@DcSite/Nissan/Service/painting-titles.html.twig');
  51.     }
  52.     public function tires(): ?Response
  53.     {
  54.         return $this->baseNissanRender('@DcSite/Nissan/Service/tires-hotel.html.twig', [
  55.             'serviceOrderForm' => $this->CoreFormFactory()->servicesOrderForm(ServicesOrderForm::TIRE_HOTEL)->createView(),
  56.         ]);
  57.     }
  58.     public function onlineBooking(): ?Response
  59.     {
  60.         return $this->baseNissanRender('@DcSite/Nissan/Service/online-booking.html.twig', [
  61.             'serviceForm' => $this->CoreFormFactory()->serviceForm()->createView(),
  62.             'dealerName' => $this->getDealer()->getBrand()->getName()
  63.         ]);
  64.     }
  65.     public function regulationsTo(VehicleService $vehicleService): ?Response
  66.     {
  67.         $models $vehicleService->getModelsForRegulationsTo($this->getDealer());
  68.         return $this->baseNissanRender('@DcSite/Nissan/Service/regulations-to.html.twig', [
  69.             'models' => $models,
  70.         ]);
  71.     }
  72.     public function regulationsToModel($model): ?Response
  73.     {
  74.         $model $this->em->getRepository(Model::class)->findOneBy(['url' => $model]);
  75.         if (!$model) {
  76.             throw new NotFoundHttpException();
  77.         }
  78.         return $this->baseNissanRender('@DcSite/Nissan/Service/regulations-to-model.html.twig', [
  79.             'model' => $model->getId(),
  80.             'modelTitle' => $model->getTitle(),
  81.         ]);
  82.     }
  83.     public function multiConsultationEnter(): ?Response
  84.     {
  85.         return $this->baseNissanRender('@DcSite/Nissan/Service/consultation.html.twig');
  86.     }
  87.     public function multiConsultationForm(): ?Response
  88.     {
  89.         return $this->baseNissanRender('@DcSite/Nissan/Service/consultation-form.html.twig');
  90.     }
  91.     public function multiConsultationFormOnline(): ?Response
  92.     {
  93.         return $this->baseNissanRender('@DcSite/Nissan/Service/consultation-form-online.html.twig');
  94.     }
  95.     public function multiConsultationTestdriveForm(): ?Response
  96.     {
  97.         return $this->baseNissanRender('@DcSite/Nissan/Service/consultation-testdrive-form.html.twig');
  98.     }
  99.     public function nightServiceAgreement(): ?Response
  100.     {
  101.         return $this->baseNissanRender('@DcSite/Nissan/Service/night-service-agreement.html.twig', [
  102.             'dealer' => $this->getDealer()
  103.         ]);
  104.     }
  105. }