<?php
namespace App\Twig;
use App\Services\Core\Contacts;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
use Twig\TwigFilter;
class ContactsExtension extends AbstractExtension
{
public function __construct(Contacts $contacts)
{
$this->contacts = $contacts;
}
/**
* {@inheritdoc}
*/
public function getFunctions(): array
{
return [
new TwigFunction('getContactsFormValue', [$this, 'getContactsFormValue']),
new TwigFunction('getCountLeads', [$this, 'getCountLeads']),
];
}
public function getContactsFormValue($sessionID,$identifiant)
{
return $this->contacts->getValue($sessionID,$identifiant);
}
public function getCountLeads()
{
return $this->contacts->getLeads();
}
}