src/DcSiteBundle/Controller/Honda/HondaServiceController.php line 107

Open in your IDE?
  1. <?php
  2. namespace DcSiteBundle\Controller\Honda;
  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\Services\VehicleService;
  11. use Doctrine\ORM\EntityManagerInterface;
  12. use PortalBundle\Model\SeoMetaTag;
  13. use Symfony\Component\DependencyInjection\ContainerInterface;
  14. use Symfony\Component\Filesystem\Filesystem;
  15. use Symfony\Component\HttpFoundation\RedirectResponse;
  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 HondaServiceController extends BaseController
  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 signHonda(): ?Response
  29.     {
  30.         return $this->baseHondaRender('@DcSite/Honda/HondaService/order-to.html.twig', [
  31.             'serviceForm' => $this->CoreFormFactory()->serviceForm()->createView(),
  32.             'dealer' => $this->getDealer(),
  33.             'dealerName' => $this->getDealer()->getBrand()->getName()
  34.         ]);
  35.     }
  36.     public function regulationsTo(VehicleService $vehicleService): ?Response
  37.     {
  38.         $models $vehicleService->getModelsForRegulationsTo($this->getDealer());
  39.         return $this->baseHondaRender('@DcSite/Honda/HondaService/regulations-to.html.twig', [
  40.             'models' => $models,
  41.         ]);
  42.     }
  43.     public function regulationsToModel($model): ?Response
  44.     {
  45.         $model $this->em->getRepository(Model::class)->findOneBy(['url' => $model]);
  46.         if (!$model) {
  47.             throw new NotFoundHttpException();
  48.         }
  49.         return $this->baseHondaRender('@DcSite/Honda/HondaService/regulations-to-model.html.twig', [
  50.             'model' => $model->getId(),
  51.             'modelTitle' => $model->getTitle(),
  52.         ]);
  53.     }
  54.     public function sparesHonda(): ?Response
  55.     {
  56.         return $this->baseHondaRender('@DcSite/Honda/HondaService/spare-parts.html.twig');
  57.     }
  58.     public function autoCheckHonda(): ?Response
  59.     {
  60.         return $this->baseHondaRender('@DcSite/Honda/HondaService/auto-check.html.twig');
  61.     }
  62.     public function guaranteeHonda(): ?Response
  63.     {
  64.         return $this->baseHondaRender('@DcSite/Honda/HondaService/guarantee.html.twig');
  65.     }
  66.     public function cardSupportHonda(): ?Response
  67.     {
  68.         return $this->baseHondaRender('@DcSite/Honda/HondaService/card-support.html.twig');
  69.     }
  70.     public function bodyRepairHonda(): ?Response
  71.     {
  72.         $repairPhotoForm $this->CoreFormFactory()->repairPhotoForm();
  73.         return $this->baseHondaRender('@DcSite/Honda/HondaService/body-repair.html.twig', [
  74.             'repairPhotoForm' => $repairPhotoForm->createView(),
  75.         ]);
  76.     }
  77.     public function accessories(ContainerInterface $container): RedirectResponse
  78.     {
  79.         return $this->redirect('https://' $container->getParameter('shop_honda_host') . '/'Response::HTTP_MOVED_PERMANENTLY);
  80.     }
  81.     public function extendedWarranty(): ?Response
  82.     {
  83.         return $this->baseHondaRender('@DcSite/Honda/HondaService/extended-warranty.html.twig', [
  84.             'servicesForm' => $this->CoreFormFactory()->extendedWarrantyForm(null$this->getDealer())->createView(),
  85.         ]);
  86.     }
  87.     public function multiConsultationEnter(): ?Response
  88.     {
  89.         return $this->baseHondaRender('@DcSite/Honda/HondaService/consultation.html.twig');
  90.     }
  91.     public function multiConsultationForm(): ?Response
  92.     {
  93.         return $this->baseHondaRender('@DcSite/Honda/HondaService/consultation-form.html.twig');
  94.     }
  95.     public function multiConsultationFormOnline(): ?Response
  96.     {
  97.         return $this->baseHondaRender('@DcSite/Honda/HondaService/consultation-form-online.html.twig');
  98.     }
  99.     public function multiConsultationTestdriveForm(): ?Response
  100.     {
  101.         return $this->baseHondaRender('@DcSite/Honda/HondaService/consultation-testdrive-form.html.twig');
  102.     }
  103.     public function nightServiceAgreement(): ?Response
  104.     {
  105.         return $this->baseHondaRender('@DcSite/Honda/HondaService/night-service-agreement.html.twig', [
  106.             'dealer' => $this->getDealer()
  107.         ]);
  108.     }
  109. }