mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
45 lines
1.4 KiB
PHP
45 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\CalendarBundle\Service\GenericDoc\Renderers;
|
|
|
|
use Chill\CalendarBundle\Repository\CalendarDocRepository;
|
|
use Chill\CalendarBundle\Service\GenericDoc\Providers\AccompanyingPeriodCalendarGenericDocProvider;
|
|
use Chill\DocStoreBundle\GenericDoc\GenericDocDTO;
|
|
use Chill\DocStoreBundle\GenericDoc\Twig\GenericDocRendererInterface;
|
|
|
|
final class AccompanyingPeriodCalendarGenericDocRenderer implements GenericDocRendererInterface
|
|
{
|
|
private CalendarDocRepository $repository;
|
|
|
|
public function __construct(CalendarDocRepository $calendarDocRepository)
|
|
{
|
|
$this->repository = $calendarDocRepository;
|
|
}
|
|
|
|
public function supports(GenericDocDTO $genericDocDTO, $options = []): bool
|
|
{
|
|
return $genericDocDTO->key === AccompanyingPeriodCalendarGenericDocProvider::KEY;
|
|
}
|
|
|
|
public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string
|
|
{
|
|
return '@ChillCalendar/GenericDoc/calendar_document.html.twig';
|
|
}
|
|
|
|
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array
|
|
{
|
|
return [
|
|
'document' => $this->repository->find($genericDocDTO->identifiers['id'])
|
|
];
|
|
}
|
|
}
|