Skip to content

Commit

Permalink
[Admin] Improve Election list queryBuilder (#7159)
Browse files Browse the repository at this point in the history
ottaviano authored Apr 11, 2022
1 parent 9f744b8 commit 5b19382
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Admin/Designation/VotingPlatformElectionAdmin.php
Original file line number Diff line number Diff line change
@@ -18,6 +18,9 @@

class VotingPlatformElectionAdmin extends AbstractAdmin
{
protected $maxPerPage = 40;
protected $perPageOptions = [];

public function createQuery($context = 'list')
{
$queryBuilder = parent::createQuery($context);
@@ -28,11 +31,22 @@ public function createQuery($context = 'list')
->leftJoin('o.electionPools', 'pool')
->leftJoin('o.electionRounds', 'election_round')
->leftJoin('o.electionEntity', 'election_entity')
->leftJoin('o.votersList', 'voters_list')
->leftJoin('election_entity.committee', 'committee')
->leftJoin('election_entity.territorialCouncil', 'territorial_council')
->leftJoin('o.designation', 'designation')
->leftJoin('pool.candidateGroups', 'candidate_group')
->addSelect('pool', 'candidate_group', 'election_round', 'election_entity', 'designation', 'committee', 'territorial_council', 'election_result')
->addSelect(
'pool',
'candidate_group',
'election_round',
'election_entity',
'designation',
'committee',
'territorial_council',
'election_result',
'voters_list',
)
;
}

0 comments on commit 5b19382

Please sign in to comment.