mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Adjust gender aggregator
This commit is contained in:
parent
843a2a4b5b
commit
bdfdabe10e
@ -22,7 +22,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final readonly class GenderAggregator implements AggregatorInterface
|
||||
{
|
||||
public function __construct(private TranslatorInterface $translator, private TranslatableStringHelperInterface $translatableStringHelper, GenderRepository $repository) {}
|
||||
public function __construct(private TranslatorInterface $translator, private TranslatableStringHelperInterface $translatableStringHelper, private GenderRepository $repository) {}
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
@ -31,7 +31,8 @@ final readonly class GenderAggregator implements AggregatorInterface
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb->addSelect('person.gender as gender');
|
||||
$qb->leftJoin('person.gender', 'g');
|
||||
$qb->addSelect('g.id as gender');
|
||||
|
||||
$qb->addGroupBy('gender');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user