Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. // Źle sortuje
  2. $qb = $this->createQueryBuilder('t');
  3. $qb->select('t, team, league')
  4. ->leftJoin('t.team', 'team')
  5. ->leftJoin('t.league', 'league')
  6. ->orderBy('t.points', 'DESC')
  7. ->orderBy('t.shootGoal', 'DESC')
  8. ->orderBy('t.loseGoal', 'ASC')
  9. ;
  10. // Dobrze sortuje
  11. $table = $teamInLeagueRepository->findBy(
  12. [],
  13. [
  14. 'points' => 'DESC',
  15. 'shootGoal' => 'DESC',
  16. 'loseGoal' => 'ASC'
  17. ]
  18. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement