src/DcSiteBundle/Controller/Honda/AcuraServiceController.php line 50

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\Filesystem\Filesystem;
  14. use Symfony\Component\HttpFoundation\RequestStack;
  15. use Symfony\Component\HttpFoundation\Response;
  16. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  17. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  18. use Symfony\Component\Routing\RouterInterface;
  19. use Twig\Environment;
  20. class AcuraServiceController extends BaseController
  21. {
  22.     public function __construct(CoreFormFactory $coreFormFactorySeoMetaTag $seoMetaTagRequestStack $requestStackRouterInterface $routerFormManager $formManagerEntityManagerInterface $emApiServer1C $apiServer1CSessionInterface $sessionFilesystem $filesystemMediaExtensionVidi $mediaExtensionVidiRepository $vehicleRepositoryVehicleFactory $vehicleFactoryEnvironment $twig)
  23.     {
  24.         parent::__construct($coreFormFactory$seoMetaTag$requestStack$router$formManager$em$apiServer1C$session$filesystem$mediaExtensionVidi$vehicleRepository$vehicleFactory$twig);
  25.     }
  26.     public function signAcura(): ?Response
  27.     {
  28.         return $this->baseHondaRender('@DcSite/Honda/AcuraService/order-to.html.twig', [
  29.             'serviceForm' => $this->CoreFormFactory()->serviceForm()->createView(),
  30.             'dealer' => $this->getDealer(),
  31.             'dealerName' => 'Acura'
  32.         ]);
  33.     }
  34.     public function regulationsTo(VehicleService $vehicleService): ?Response
  35.     {
  36.         $models $vehicleService->getModelsForRegulationsTo($this->getDealer(), 32);
  37.         return $this->baseHondaRender('@DcSite/Honda/AcuraService/regulations-to.html.twig', [
  38.             'models' => $models,
  39.             'dealerName' => 'Acura'
  40.         ]);
  41.     }
  42.     public function regulationsToModel($model): ?Response
  43.     {
  44.         $model $this->em->getRepository(Model::class)->findOneBy(['url' => $model]);
  45.         if (!$model) {
  46.             throw new NotFoundHttpException();
  47.         }
  48.         return $this->baseHondaRender('@DcSite/Honda/AcuraService/regulations-to-model.html.twig', [
  49.             'model' => $model->getId(),
  50.             'modelTitle' => $model->getTitle(),
  51.             'dealerName' => 'Acura'
  52.         ]);
  53.     }
  54.     public function sparesAcura(): ?Response
  55.     {
  56.         return $this->baseHondaRender('@DcSite/Honda/AcuraService/spare-parts.html.twig');
  57.     }
  58.     public function autoCheckAcura(): ?Response
  59.     {
  60.         return $this->baseHondaRender('@DcSite/Honda/AcuraService/auto-check.html.twig');
  61.     }
  62.     public function guaranteeAcura(): ?Response
  63.     {
  64.         return $this->baseHondaRender('@DcSite/Honda/AcuraService/guarantee.html.twig');
  65.     }
  66. }