src/Twig/HousesExtension.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Twig;
  3. use App\Services\Core\Bank;
  4. use App\Services\Core\Core;
  5. use App\Services\Core\Users;
  6. use App\Services\House;
  7. use App\Services\Messages;
  8. use Twig\Extension\AbstractExtension;
  9. use Twig\TwigFilter;
  10. use Twig\TwigFunction;
  11. class HousesExtension extends AbstractExtension
  12. {
  13.     public function __construct(Core $coreService,
  14.                                 Users $userService,
  15.                                 \App\Services\Menu\Core $coreMenu,
  16.                                 Bank $bank,
  17.                                 House $house,
  18.                                 Messages $message
  19.     ) {
  20.         $this->core $coreService;
  21.         $this->users $userService;
  22.         $this->coreMenu $coreMenu;
  23.         $this->bank $bank;
  24.         $this->house $house;
  25.         $this->message $message;
  26.     }
  27.     public function getFunctions(): array
  28.     {
  29.         return [
  30.             new  TwigFunction('getHousesUserAgency', [$this'getHousesUserAgency']),
  31.             new  TwigFunction('getHousesHouseFavoris', [$this'getHousesHouseFavoris']),
  32.             new  TwigFunction('getHousesHouseCandidatures', [$this'getHousesHouseCandidatures']),
  33.             new  TwigFunction('getHousesFirstPhoto', [$this'getHousesFirstPhoto']),
  34.             new  TwigFunction('getHousesAgencyHousesCount', [$this'getHousesAgencyHousesCount']),
  35.             new  TwigFunction('getHousesLinks', [$this'getHousesLinks']),
  36.             new  TwigFunction('getHousesMenu', [$this'getHousesMenu']),
  37.             new  TwigFunction('getHousesMenuLinks', [$this'getHousesMenuLinks']),
  38.             new  TwigFunction('getHousesExternalUrl', [$this'getHousesExternalUrl']),
  39.             new  TwigFunction('getHousesMenuHeaderLinks', [$this'getHousesMenuHeaderLinks']),
  40.             new  TwigFunction('getSyndicatsPropertyLots', [$this'getSyndicatsPropertyLots']),
  41.         ];
  42.     }
  43.     public function getFilters()
  44.     {
  45.         return [
  46.             new TwigFilter('clean_n', [$this'clean_n']),
  47.         ];
  48.     }
  49.     public function getSyndicatsPropertyLots($syndicatPropertyID)
  50.     {
  51.         return $this->house->getSyndicatsPropertyLots($syndicatPropertyID);
  52.     }
  53.     public function getHousesExternalUrl($url)
  54.     {
  55.         return $this->house->externalUrl($url);
  56.     }
  57.     public function getHousesMenuLinks($menuFooter)
  58.     {
  59.         return $this->house->getMenuLinks($menuFooter);
  60.     }
  61.     public function getHousesLinks($agency null)
  62.     {
  63.         return $this->house->getLinks($agency);
  64.     }
  65.     public function getHousesMenu($agency null)
  66.     {
  67.         return $this->house->getMenu($agency);
  68.     }
  69.     public function getHousesMenuHeaderLinks($agency null,$name)
  70.     {
  71.         return $this->house->getMenuHeaderLinks($agency,$name);
  72.     }
  73.     public function getHousesAgencyHousesCount($agencyID)
  74.     {
  75.         return $this->house->countOnline($agencyID);
  76.     }
  77.     public function getHousesFirstPhoto($houseID)
  78.     {
  79.         return $this->house->getFirstPhoto($houseID);
  80.     }
  81.     public function getHousesHouseFavoris($houseID,$userID)
  82.     {
  83.         return $this->house->favoris($houseID,$userID);
  84.     }
  85.     public function getHousesHouseCandidatures($houseID,$userID)
  86.     {
  87.         return $this->house->candidatures($houseID,$userID);
  88.     }
  89.     public function getHousesUserAgency($userID)
  90.     {
  91.         return $this->house->getUserAgency($userID);
  92.     }
  93. }