minor changes

This commit is contained in:
2022-08-30 13:14:40 +02:00
parent cf642d2783
commit 72b5fcf998
3 changed files with 13 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Export\Declarations;
use Chill\PersonBundle\Repository\SocialWork\ResultRepository;
use Doctrine\ORM\QueryBuilder;
@@ -21,9 +22,12 @@ final class ResultAggregator implements AggregatorInterface
{
private ResultRepository $resultRepository;
public function __construct(ResultRepository $resultRepository)
private TranslatableStringHelper $translatableStringHelper;
public function __construct(ResultRepository $resultRepository, TranslatableStringHelper $translatableStringHelper)
{
$this->resultRepository = $resultRepository;
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole()
@@ -34,7 +38,9 @@ final class ResultAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
$qb->join('acpw.results', 'res');
$qb->addSelect('res.id as result_aggregator');
$qb->join('acpw.goals', 'g');
$qb->join('g.results', 'gres');
$qb->addSelect('res.id, IDENTITY(g.results) as result_aggregator');
$groupBy = $qb->getDQLPart('groupBy');