- <?php
- namespace DcSiteBundle\Controller\Nissan;
- use CoreBundle\Component\CoreFormFactory;
- use CoreBundle\Component\FormManager;
- use CoreBundle\Entity\Model;
- use CoreBundle\Factory\Vehicle as VehicleFactory;
- use CoreBundle\Model\Api\OnlineService\ApiServer1C;
- use CoreBundle\Model\Vehicles\Repository;
- use CoreBundle\Services\MediaExtensionVidi;
- use DcSiteBundle\Model\Form\ServicesOrderForm;
- use DcSiteBundle\Services\VehicleService;
- use Doctrine\ORM\EntityManagerInterface;
- use PortalBundle\Model\SeoMetaTag;
- use Symfony\Component\Filesystem\Filesystem;
- use Symfony\Component\HttpFoundation\RequestStack;
- use Symfony\Component\HttpFoundation\Response;
- use Symfony\Component\HttpFoundation\Session\SessionInterface;
- use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
- use Symfony\Component\Routing\RouterInterface;
- use Twig\Environment;
- class ServiceController extends BaseController
- {
-     public function __construct(CoreFormFactory $coreFormFactory, SeoMetaTag $seoMetaTag, RequestStack $requestStack, RouterInterface $router, FormManager $formManager, EntityManagerInterface $em, ApiServer1C $apiServer1C, SessionInterface $session, Filesystem $filesystem, MediaExtensionVidi $mediaExtensionVidi, Repository $vehicleRepository, VehicleFactory $vehicleFactory, Environment $twig)
-     {
-         parent::__construct($coreFormFactory, $seoMetaTag, $requestStack, $router, $formManager, $em, $apiServer1C, $session, $filesystem, $mediaExtensionVidi, $vehicleRepository, $vehicleFactory, $twig);
-     }
-     public function accessories(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/accessories.html.twig', [
-             'spareForm' => $this->CoreFormFactory()->buySparePartsForm($this->getDealer())->createView(),
-         ]);
-     }
-     public function bodyService(): ?Response
-     {
-         $repairPhotoForm = $this->CoreFormFactory()->repairPhotoForm();
-         return $this->baseNissanRender('@DcSite/Nissan/Service/body-service.html.twig', [
-             'repairPhotoForm' => $repairPhotoForm->createView(),
-         ]);
-     }
-     public function guarantee(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/guarantee.html.twig');
-     }
-     public function interactive(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/interactive-acceptance.html.twig');
-     }
-     public function painting(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/painting-titles.html.twig');
-     }
-     public function tires(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/tires-hotel.html.twig', [
-             'serviceOrderForm' => $this->CoreFormFactory()->servicesOrderForm(ServicesOrderForm::TIRE_HOTEL)->createView(),
-         ]);
-     }
-     public function onlineBooking(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/online-booking.html.twig', [
-             'serviceForm' => $this->CoreFormFactory()->serviceForm()->createView(),
-             'dealerName' => $this->getDealer()->getBrand()->getName()
-         ]);
-     }
-     public function regulationsTo(VehicleService $vehicleService): ?Response
-     {
-         $models = $vehicleService->getModelsForRegulationsTo($this->getDealer());
-         return $this->baseNissanRender('@DcSite/Nissan/Service/regulations-to.html.twig', [
-             'models' => $models,
-         ]);
-     }
-     public function regulationsToModel($model): ?Response
-     {
-         $model = $this->em->getRepository(Model::class)->findOneBy(['url' => $model]);
-         if (!$model) {
-             throw new NotFoundHttpException();
-         }
-         return $this->baseNissanRender('@DcSite/Nissan/Service/regulations-to-model.html.twig', [
-             'model' => $model->getId(),
-             'modelTitle' => $model->getTitle(),
-         ]);
-     }
-     public function multiConsultationEnter(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/consultation.html.twig');
-     }
-     public function multiConsultationForm(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/consultation-form.html.twig');
-     }
-     public function multiConsultationFormOnline(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/consultation-form-online.html.twig');
-     }
-     public function multiConsultationTestdriveForm(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/consultation-testdrive-form.html.twig');
-     }
-     public function nightServiceAgreement(): ?Response
-     {
-         return $this->baseNissanRender('@DcSite/Nissan/Service/night-service-agreement.html.twig', [
-             'dealer' => $this->getDealer()
-         ]);
-     }
- }
-