src/DcSiteBundle/Controller/NissanArmada/AboutUsController.php line 67

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\Post;
  6. use CoreBundle\Factory\Vehicle as VehicleFactory;
  7. use CoreBundle\Model\Api\OnlineService\ApiServer1C;
  8. use CoreBundle\Model\Vehicles\Repository;
  9. use CoreBundle\Model\ViDiWorkerModel;
  10. use CoreBundle\Services\MediaExtensionVidi;
  11. use DcSiteBundle\Entity\Vacancy;
  12. use Doctrine\ORM\EntityManagerInterface;
  13. use PortalBundle\Model\SeoMetaTag;
  14. use Symfony\Component\Filesystem\Filesystem;
  15. use Symfony\Component\HttpFoundation\Request;
  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 AboutUsController 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 contacts(): ?Response
  29.     {
  30.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/contacts.html.twig');
  31.     }
  32.     public function aboutDc(): ?Response
  33.     {
  34.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/about-nissan.html.twig');
  35.     }
  36.     public function staff(Request $requestViDiWorkerModel $viDiWorkerModel): ?Response
  37.     {
  38.         $workers $viDiWorkerModel->getAllByDealer($this->getDealer(), $request->getLocale());
  39.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/staff.html.twig', [
  40.             'workers' => $workers,
  41.         ]);
  42.     }
  43.     public function news(): ?Response
  44.     {
  45.         $postRepository $this->em->getRepository(Post::class);
  46.         $news $postRepository->getNewsByDealer($this->getDealer());
  47.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/news.html.twig', ['news' => $news]);
  48.     }
  49.     public function newsSingle(Request $request\CoreBundle\Model\Post $postModel): ?Response
  50.     {
  51.         $post $postModel->initByUrl($this->getDealer(), $request->get('url'));
  52.         $toread $post->getReadMore();
  53.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/news-single.html.twig', [
  54.             'post' => $post,
  55.             'toread' => $toread
  56.         ]);
  57.     }
  58.     public function personalData(): ?Response
  59.     {
  60.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/personal-data-policy.html.twig', ['dealer' => $this->getDealer()]);
  61.     }
  62.     public function quality(): ?Response
  63.     {
  64.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/quality.html.twig');
  65.     }
  66.     //    Вакансії
  67.     public function vacancy(): ?Response
  68.     {
  69.         $vacancies $this->em->getRepository(Vacancy::class)->getByDealer($this->getDealer());
  70.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/vacancy.html.twig', [
  71.             'vacancies' => $vacancies,
  72.         ]);
  73.     }
  74.     //    Вакансія ID
  75.     public function vacancyId($id): ?Response
  76.     {
  77.         $vacancy $this->em->getRepository(Vacancy::class)->getByID($id);
  78.         if (!$vacancy) {
  79.             throw new NotFoundHttpException();
  80.         }
  81.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/vacancy-id.html.twig', [
  82.             'vacancy' => $vacancy,
  83.             'vacancyForm' => $this->get('core.form.factory')->vacancyForm($this->getDealer(), $vacancy)->createView(),
  84.         ]);
  85.     }
  86.     public function publicOffer(): ?Response
  87.     {
  88.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/public-offer.html.twig', ['dealer' => $this->getDealer()]);
  89.     }
  90.     public function returnRefundPolicies(): ?Response
  91.     {
  92.         return $this->baseNissanArmada('@DcSite/Nissan_Armada/AboutUs/return-refund-policies.html.twig');
  93.     }
  94. }