mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
Fix "group activity by creator job" aggregator
This commit is contained in:
@@ -14,18 +14,18 @@ namespace Chill\ActivityBundle\Export\Aggregator;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\MainBundle\Entity\User\UserJobHistory;
|
||||
use Chill\MainBundle\Export\AggregatorInterface;
|
||||
use Chill\MainBundle\Repository\ScopeRepository;
|
||||
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Doctrine\ORM\Query\Expr\Join;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class JobScopeAggregator implements AggregatorInterface
|
||||
class CreatorJobAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_agg_creator_job';
|
||||
|
||||
public function __construct(
|
||||
private readonly ScopeRepository $scopeRepository,
|
||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||
private readonly TranslatableStringHelper $translatableStringHelper
|
||||
) {}
|
||||
|
||||
@@ -76,17 +76,15 @@ class JobScopeAggregator implements AggregatorInterface
|
||||
{
|
||||
return function ($value): string {
|
||||
if ('_header' === $value) {
|
||||
return 'Scope';
|
||||
return 'Job';
|
||||
}
|
||||
|
||||
if (null === $value || '' === $value) {
|
||||
if (null === $value || '' === $value || null === $s = $this->userJobRepository->find($value)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$s = $this->scopeRepository->find($value);
|
||||
|
||||
return $this->translatableStringHelper->localize(
|
||||
$s->getName()
|
||||
$s->getLabel()
|
||||
);
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user