<?php
namespace App\Twig;
use App\Services\Manage\Checklist;
use App\Services\Manage\Manager;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
class ManagerExtension extends AbstractExtension
{
public function __construct(Manager $manager)
{
$this->manager = $manager;
}
public function getFunctions(): array
{
return [
new TwigFunction('getManagerChecklist', [$this, 'getManagerChecklist']),
new TwigFunction('getManagerProjects', [$this, 'getManagerProjects']),
];
}
public function getManagerChecklist($checklistID)
{
return $this->manager->getChecklist($checklistID);
}
public function getManagerProjects($userID)
{
return $this->manager->getProjects($userID);
}
}