mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 23:04:58 +00:00
WIP [genericDoc][activity] implementing generic doc for activities
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?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\ActivityBundle\Service\GenericDoc\Renderers;
|
||||
|
||||
use Chill\ActivityBundle\Service\GenericDoc\Providers\AccompanyingPeriodActivityGenericDocProvider;
|
||||
use Chill\DocStoreBundle\GenericDoc\GenericDocDTO;
|
||||
use Chill\DocStoreBundle\GenericDoc\Twig\GenericDocRendererInterface;
|
||||
use Chill\DocStoreBundle\Repository\StoredObjectRepository;
|
||||
|
||||
final class AccompanyingPeriodActivityGenericDocRenderer implements GenericDocRendererInterface
|
||||
{
|
||||
private StoredObjectRepository $repository;
|
||||
|
||||
public function __construct(StoredObjectRepository $storedObjectRepository)
|
||||
{
|
||||
$this->repository = $storedObjectRepository;
|
||||
}
|
||||
|
||||
public function supports(GenericDocDTO $genericDocDTO, $options = []): bool
|
||||
{
|
||||
return $genericDocDTO->key === AccompanyingPeriodActivityGenericDocProvider::KEY;
|
||||
}
|
||||
|
||||
public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string
|
||||
{
|
||||
return '@ChillCalendar/GenericDoc/activity_document.html.twig';
|
||||
}
|
||||
|
||||
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array
|
||||
{
|
||||
return [
|
||||
'document' => $this->repository->find($genericDocDTO->identifiers['id'])
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user