<?php
namespace App\Twig;
use App\Services\Core\Core;
use App\Services\Core\Tools;
use App\Services\Core\Users;
use App\Services\Cvs;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
class CvsExtension extends AbstractExtension
{
public function __construct(Core $coreService,
Tools $toolService,
Users $usersService,
Cvs $cvsService
){
$this->core = $coreService;
$this->tool = $toolService;
$this->users = $usersService;
$this->cvs = $cvsService;
}
public function getFunctions(): array
{
return [
new TwigFunction('getSidebarCvsDiscussions', [$this, 'getSidebarCvsDiscussions']),
new TwigFunction('getSidebarCvsCandidatesDiscussions', [$this, 'getSidebarCvsCandidatesDiscussions']),
new TwigFunction('getCvsCountMessagesDiscussion', [$this, 'getCvsCountMessagesDiscussion']),
new TwigFunction('getCvsCountMessagesDiscussions', [$this, 'getCvsCountMessagesDiscussions']),
new TwigFunction('getCvsCandidateSkills', [$this, 'getCvsCandidateSkills']),
new TwigFunction('getCvsMetiers', [$this, 'getCvsMetiers']),
new TwigFunction('getCvsFaq', [$this, 'getCvsFaq']),
new TwigFunction('getCvsSendingCV', [$this, 'getCvsSendingCV']),
new TwigFunction('getCvsCandidate', [$this, 'getCvsCandidate']),
new TwigFunction('getCvsCandidateUser', [$this, 'getCvsCandidateUser']),
];
}
public function getFilters()
{
return [];
}
public function getCvsCandidateUser($candidateID)
{
return $this->cvs->getCvsCandidateUser($candidateID);
}
public function getCvsCandidate($userID)
{
return $this->cvs->getCandidate($userID);
}
public function getCvsSendingCV($userID,$userTargetID,$anonyme)
{
return $this->cvs->getSendingCV($userID,$userTargetID,$anonyme);
}
public function getCvsMetiers()
{
return $this->cvs->getBigCategories();
}
public function getCvsFaq($categoryID)
{
return $this->cvs->getFaqByCategory($categoryID);
}
public function getCvsCandidateSkills($candidateID,$number)
{
return $this->cvs->getCandidateSkills($candidateID,$number);
}
public function getCvsCountMessagesDiscussion($discussionID,$userID)
{
return $this->cvs->getCountMessagesDiscussion($discussionID,$userID);
}
public function getCvsCountMessagesDiscussions($userID)
{
return $this->cvs->getCountMessagesDiscussions($userID);
}
public function getSidebarCvsDiscussions($agencyID)
{
return $this->cvs->getDiscussions($agencyID);
}
public function getSidebarCvsCandidatesDiscussions($userID)
{
return $this->cvs->getCandidatesDiscussions($userID);
}
}