src/AutomarketBundle/Controller/AboutController.php line 29

Open in your IDE?
  1. <?php
  2. namespace AutomarketBundle\Controller;
  3. use CoreBundle\Component\CoreFormFactory;
  4. use CoreBundle\Model\ViDiWorkerModel;
  5. use DcSiteBundle\Entity\Vacancy;
  6. use Doctrine\ORM\EntityManagerInterface;
  7. use PortalBundle\Model\SeoMetaTag;
  8. use Symfony\Component\HttpFoundation\Request;
  9. use Symfony\Component\HttpFoundation\RequestStack;
  10. use Symfony\Component\HttpFoundation\Response;
  11. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  12. class AboutController extends BaseController
  13. {
  14.     public function __construct(CoreFormFactory $coreFormFactoryRequestStack $requestStackEntityManagerInterface $emSeoMetaTag $seoMetaTag)
  15.     {
  16.         parent::__construct($coreFormFactory$requestStack$em$seoMetaTag);
  17.     }
  18.     public function staff(Request $requestViDiWorkerModel $viDiWorkerModel): Response
  19.     {
  20.         $staff $viDiWorkerModel->getAllByDealer($this->getDealer(), $request->getLocale());
  21.         return $this->baseAutomarketRender('@Automarket/AboutCompany/staff.html.twig', ['staff' => $staff]);
  22.     }
  23.     public function aboutAutomarket(Request $requestViDiWorkerModel $viDiWorkerModel): Response
  24.     {
  25.         $workers $viDiWorkerModel->getAllByDealer($this->getDealer(), $request->getLocale());
  26.         return $this->baseAutomarketRender('@Automarket/AboutCompany/about.html.twig', ['workers' => $workers]);
  27.     }
  28.     public function qualityPolicy(): Response
  29.     {
  30.         return $this->baseAutomarketRender('@Automarket/AboutCompany/quality-policy.html.twig', [
  31.             'dealer' => $this->getDealer(),
  32.         ]);
  33.     }
  34.     //    Вакансії
  35.     public function vacancy(EntityManagerInterface $em): Response
  36.     {
  37.         $vacancies $em->getRepository(Vacancy::class)->getByDealer($this->getDealer());
  38.         return $this->baseAutomarketRender('@Automarket/AboutCompany/vacancy.html.twig', [
  39.             'vacancies' => $vacancies,
  40.         ]);
  41.     }
  42.     //    Вакансія ID
  43.     public function vacancyId($idEntityManagerInterface $em): Response
  44.     {
  45.         $vacancy $em->getRepository(Vacancy::class)->getByID($id);
  46.         if (!$vacancy) {
  47.             throw new NotFoundHttpException();
  48.         }
  49.         return $this->baseAutomarketRender('@Automarket/AboutCompany/vacancy-id.html.twig', [
  50.             'vacancy' => $vacancy,
  51.             'vacancyForm' => $this->get('core.form.factory')->vacancyForm($this->getDealer(), $vacancy)->createView(),
  52.         ]);
  53.     }
  54. }