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

Open in your IDE?
  1. <?php
  2. namespace DcSiteBundle\Controller\NissanArmada;
  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->baseNissanArmada('@DcSite/Nissan_Armada/Service/accessories.html.twig');
  30.     }
  31.     public function bodyService(): ?Response
  32.     {
  33.         $repairPhotoForm $this->CoreFormFactory()->repairPhotoForm();
  34.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/body-service.html.twig', [
  35.             'repairPhotoForm' => $repairPhotoForm->createView(),
  36.         ]);
  37.     }
  38.     public function guarantee(): ?Response
  39.     {
  40.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/guarantee.html.twig');
  41.     }
  42.     public function interactive(): ?Response
  43.     {
  44.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/interactive-acceptance.html.twig');
  45.     }
  46.     public function order(): ?Response
  47.     {
  48.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/order.html.twig', [
  49.             'serviceForm' => $this->CoreFormFactory()->serviceForm()->createView(),
  50.             'dealerName' => $this->getDealer()->getBrand()->getName()
  51.         ]);
  52.     }
  53.     public function regulationsTo(VehicleService $vehicleService): ?Response
  54.     {
  55.         $models $vehicleService->getModelsForRegulationsTo($this->getDealer());
  56.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/regulations-to.html.twig', [
  57.             'models' => $models,
  58.         ]);
  59.     }
  60.     public function regulationsToModel($model): ?Response
  61.     {
  62.         $model $this->em->getRepository(Model::class)->findOneBy(['url' => $model]);
  63.         if (!$model) {
  64.             throw new NotFoundHttpException();
  65.         }
  66.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/regulations-to-model.html.twig', [
  67.             'model' => $model->getId(),
  68.             'modelTitle' => $model->getTitle(),
  69.         ]);
  70.     }
  71.     public function painting(): ?Response
  72.     {
  73.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/painting-titles.html.twig');
  74.     }
  75.     public function tires(): ?Response
  76.     {
  77.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/tires-hotel.html.twig', [
  78.             'serviceOrderForm' => $this->CoreFormFactory()->servicesOrderForm(ServicesOrderForm::TIRE_HOTEL)->createView(),
  79.         ]);
  80.     }
  81.     public function extendedWarranty(): ?Response
  82.     {
  83.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/extended-warranty.html.twig', [
  84.             'servicesForm' => $this->CoreFormFactory()->extendedWarrantyForm(null$this->getDealer())->createView(),
  85.         ]);
  86.     }
  87.     public function multiConsultationEnter(): ?Response
  88.     {
  89.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/consultation.html.twig');
  90.     }
  91.     public function multiConsultationForm(): ?Response
  92.     {
  93.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/consultation-form.html.twig');
  94.     }
  95.     public function multiConsultationFormOnline(): ?Response
  96.     {
  97.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/consultation-form-online.html.twig');
  98.     }
  99.     public function multiConsultationTestdriveForm(): ?Response
  100.     {
  101.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/consultation-testdrive-form.html.twig');
  102.     }
  103.     public function nightServiceAgreement(): ?Response
  104.     {
  105.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/Service/night-service-agreement.html.twig', [
  106.             'dealer' => $this->getDealer()
  107.         ]);
  108.     }
  109. }