mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
[export] add a filter and aggregator on activities: filter/group by persons taking part to the activity
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user