src/Twig/DossiersExtension.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Twig;
  3. use App\Services\Dossiers;
  4. use App\Services\House;
  5. use App\Tools\Houses\SituationStatus;
  6. use Twig\Extension\AbstractExtension;
  7. use Twig\TwigFilter;
  8. use Twig\TwigFunction;
  9. class DossiersExtension extends AbstractExtension {
  10.     public function __construct(Dossiers $dossiersHouse $house) {
  11.         $this->dossiers $dossiers;
  12.         $this->house $house;
  13.     }
  14.     /**
  15.      * {@inheritdoc}
  16.      */
  17.     public function getFunctions(): array
  18.     {
  19.         return [
  20.             new  TwigFunction('getDossiersItem', [$this'getDossiersItem']),
  21.             new  TwigFunction('getDossiersArrayWidgets', [$this'getDossiersArrayWidgets']),
  22.             new  TwigFunction('getDossiersTotalHtWidgets', [$this'getDossiersTotalHtWidgets']),
  23.             new  TwigFunction('getDossiersTotalTtcWidgets', [$this'getDossiersTotalTtcWidgets']),
  24.             new  TwigFunction('getDossiersHousesDocument', [$this'getDossiersHousesDocument']),
  25.             new  TwigFunction('getHousesSituationTool', [$this'getHousesSituationTool']),
  26.         ];
  27.     }
  28.     public function getHousesSituationTool($status)
  29.     {
  30.         return SituationStatus::getStatus($status);
  31.     }
  32.     public function getDossiersHousesDocument($dossierID,$documentID)
  33.     {
  34.         return $this->house->getDossierDocument($dossierID,$documentID);
  35.     }
  36.     public function getDossiersItem($ficheID,$groupID)
  37.     {
  38.         return $this->dossiers->getItems($ficheID,$groupID);
  39.     }
  40.     public function getDossiersArrayWidgets($detailID)
  41.     {
  42.         return $this->dossiers->getArrayWidgets($detailID);
  43.     }
  44.     public function getDossiersTotalHtWidgets($detailID)
  45.     {
  46.         return $this->dossiers->getWidgetTotalHT($detailID);
  47.     }
  48.     public function getDossiersTotalTtcWidgets($detailID)
  49.     {
  50.         return $this->dossiers->getWidgetTotalTTC($detailID);
  51.     }
  52. }