[export] add a filter and aggregator on activities: filter/group by persons taking part to the activity

This commit is contained in:
2023-10-18 16:03:26 +02:00
parent a4edb34668
commit 11fb9bcd0b
8 changed files with 333 additions and 0 deletions

View File

@@ -18,6 +18,21 @@ class LabelPersonHelper
{
public function __construct(private readonly PersonRepository $personRepository, private readonly PersonRenderInterface $personRender) {}
public function getLabel(string $key, array $values, string $header): callable
{
return function (null|int|string $value) use ($header): string {
if ('_header' === $value) {
return $header;
}
if ('' === $value || null === $value || null === $person = $this->personRepository->find($value)) {
return '';
}
return $this->personRender->renderString($person, []);
};
}
public function getLabelMulti(string $key, array $values, string $header): callable
{
return function ($value) use ($header) {