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
7520d746e8
commit
9f3893243e
@ -22,7 +22,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
final readonly class GenderAggregator implements AggregatorInterface
|
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
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
@ -31,7 +31,8 @@ final readonly class GenderAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
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');
|
$qb->addGroupBy('gender');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user