src/Twig/CvsExtension.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Twig;
  3. use App\Services\Core\Core;
  4. use App\Services\Core\Tools;
  5. use App\Services\Core\Users;
  6. use App\Services\Cvs;
  7. use Twig\Extension\AbstractExtension;
  8. use Twig\TwigFilter;
  9. use Twig\TwigFunction;
  10. class CvsExtension extends AbstractExtension
  11. {
  12.     public function __construct(Core $coreService,
  13.                                 Tools $toolService,
  14.                                 Users $usersService,
  15.                                 Cvs $cvsService
  16.     ){
  17.         $this->core $coreService;
  18.         $this->tool $toolService;
  19.         $this->users $usersService;
  20.         $this->cvs $cvsService;
  21.     }
  22.     public function getFunctions(): array
  23.     {
  24.         return [
  25.             new  TwigFunction('getSidebarCvsDiscussions', [$this'getSidebarCvsDiscussions']),
  26.             new  TwigFunction('getSidebarCvsCandidatesDiscussions', [$this'getSidebarCvsCandidatesDiscussions']),
  27.             new  TwigFunction('getCvsCountMessagesDiscussion', [$this'getCvsCountMessagesDiscussion']),
  28.             new  TwigFunction('getCvsCountMessagesDiscussions', [$this'getCvsCountMessagesDiscussions']),
  29.             new  TwigFunction('getCvsCandidateSkills', [$this'getCvsCandidateSkills']),
  30.             new  TwigFunction('getCvsMetiers', [$this'getCvsMetiers']),
  31.             new  TwigFunction('getCvsFaq', [$this'getCvsFaq']),
  32.             new  TwigFunction('getCvsSendingCV', [$this'getCvsSendingCV']),
  33.             new  TwigFunction('getCvsCandidate', [$this'getCvsCandidate']),
  34.             new  TwigFunction('getCvsCandidateUser', [$this'getCvsCandidateUser']),
  35.         ];
  36.     }
  37.     public function getFilters()
  38.     {
  39.         return [];
  40.     }
  41.     public function getCvsCandidateUser($candidateID)
  42.     {
  43.         return  $this->cvs->getCvsCandidateUser($candidateID);
  44.     }
  45.     public function getCvsCandidate($userID)
  46.     {
  47.         return  $this->cvs->getCandidate($userID);
  48.     }
  49.     public function getCvsSendingCV($userID,$userTargetID,$anonyme)
  50.     {
  51.         return  $this->cvs->getSendingCV($userID,$userTargetID,$anonyme);
  52.     }
  53.     public function getCvsMetiers()
  54.     {
  55.         return  $this->cvs->getBigCategories();
  56.     }
  57.     public function getCvsFaq($categoryID)
  58.     {
  59.         return  $this->cvs->getFaqByCategory($categoryID);
  60.     }
  61.     public function getCvsCandidateSkills($candidateID,$number)
  62.     {
  63.         return  $this->cvs->getCandidateSkills($candidateID,$number);
  64.     }
  65.     public function getCvsCountMessagesDiscussion($discussionID,$userID)
  66.     {
  67.         return  $this->cvs->getCountMessagesDiscussion($discussionID,$userID);
  68.     }
  69.     public function getCvsCountMessagesDiscussions($userID)
  70.     {
  71.         return  $this->cvs->getCountMessagesDiscussions($userID);
  72.     }
  73.     public function getSidebarCvsDiscussions($agencyID)
  74.     {
  75.         return  $this->cvs->getDiscussions($agencyID);
  76.     }
  77.     public function getSidebarCvsCandidatesDiscussions($userID)
  78.     {
  79.         return  $this->cvs->getCandidatesDiscussions($userID);
  80.     }
  81. }