src/Aviatur/SearchBundle/Controller/InsuranceController.php line 16

Open in your IDE?
  1. <?php
  2. namespace Aviatur\SearchBundle\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Doctrine\Persistence\ManagerRegistry;
  6. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  7. use Aviatur\TwigBundle\Services\TwigFolder;
  8. use Aviatur\GeneralBundle\Services\AviaturChangeCoin;
  9. use Aviatur\HotelBundle\Services\SearchHotelCookie;
  10. use Aviatur\InsuranceBundle\Services\SearchInsuranceCookie;
  11. class InsuranceController extends AbstractController {
  12.     public function indexAction(ManagerRegistry $registrySessionInterface $sessionAviaturChangeCoin $aviaturChangeCoinServiceTwigFolder $twigFolderSearchInsuranceCookie $searchInsuranceCookie) {
  13.         $em $registry->getManager();
  14.         $agencyId $session->get('agencyId');
  15.         $agency $em->getRepository(\Aviatur\AgencyBundle\Entity\Agency::class)->find($agencyId);
  16.         $cookieLastSearch $searchInsuranceCookie->SearchInsuranceCookie();
  17.         $validateChange $aviaturChangeCoinService->validateChangeCoin('insurance');
  18.         $promoType '';
  19.         if($session->has('whitemark') === true){
  20.             $promoType '_' $session->get('whitemark');
  21.         }
  22.         $agenciesExcluded = ['Aviatur S.A.S.''Aviatur S.A.S. Metasearch''Aval''Aviacaribbean''Aviatur - WorldPay''Aviatur Carnaval BAQ MB''Aviatur Colombia''Aviatur Colombia EN''Aviatur Colombia ES''Aviatur Ecoturismo''Aviatur Kioskos''Aviatur Metasearch Mexico''Aviatur Mexico''Aviatur Mexico QA''Aviatur Mobile''Aviatur PinBus''Aviatur - Pruebas''BabyMarket''Buceo Colombia''Cielos Abiertos''Corona Aviatur''Directo a la Playa''Experiencias Jet-Set''Great Vibes''Landing visa''Lufthansa City Center''Megatours''Octopus Agents''Octopus Marcas Blancas''Octopus Travel QA''Panturismo Marcas Blancas''Parque Tayrona''Representaciones Pasabordo WM''Rokatur Marcas Blancas''RollingTrips''Star World''Swissandina''Takentours''TerraNet Marcas Blancas''Turiscol Ltda.''Aviatur S.A.''Union de Representaciones''Union de Representaciones - Whitemark''Virtuoso''Claro''WeCare''Octopus Travel Ltda.''Aviatur Site''Aviatur S.A.S. - BBVA''Aviatur Welcome Beds'];
  23.         $agencyPromoId 172;
  24.         $validationAgencyFolder false;
  25.         foreach ($agenciesExcluded as $agencyExcluded) {
  26.             if ($agencyExcluded === $agency->getName()) {
  27.                 $agencyPromoId $session->get('agencyId');
  28.                 $validationAgencyFolder true;
  29.             }
  30.         }
  31.         $homePromoList $em->getRepository(\Aviatur\EditionBundle\Entity\HomePromoList::class)->findOneBy(['type' => '__asistencia'.$promoType'agency' => $agencyPromoId]);
  32.         if ($homePromoList != null) {
  33.             $homePromoTitle $homePromoList->getTitle();
  34.             $homePromoSubtitle $homePromoList->getSubtitle();
  35.             $homePromos $em->getRepository(\Aviatur\EditionBundle\Entity\HomePromo::class)->findByHomePromoList($homePromoList, ['date' => 'DESC']);
  36.         } else {
  37.             $homePromoTitle null;
  38.             $homePromoSubtitle null;
  39.             $homePromos = [];
  40.         }
  41.         $isFront $session->has('operatorId');
  42.         $pixelInfo = [];
  43.         $agencyFolder $twigFolder->twigFlux();
  44.         return $this->render($twigFolder->twigExists('@AviaturTwig/' $agencyFolder '/Search/Insurance/insuranceSearch_index.html.twig'), ['pixel_info' => $pixelInfo'cookieLastSearch' => $cookieLastSearch'homePromos' => $homePromos'titlePromo' => $homePromoTitle'subtitlePromo' => $homePromoSubtitle'promoType' => '__asistencia''validationAgencyFolder' => $validationAgencyFolder]);
  45.     }
  46. }