Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function lastTeams($max = 5):Response |
||
29 | { |
||
30 | $this->denyAccessUnlessGranted(Roles::COACH); |
||
31 | |||
32 | $user = $this->getUser(); |
||
33 | $teams = []; |
||
34 | if ($user instanceof Coach) { |
||
35 | $criteria = Criteria::create() |
||
36 | ->setMaxResults($max) |
||
37 | ->orderBy(['id' => 'DESC']); |
||
38 | $teams = $user->getTeams()->matching($criteria); |
||
39 | } |
||
40 | |||
41 | return $this->render('@ObblmCore/dashboard/last-teams.html.twig', [ |
||
42 | 'teams' => $teams, |
||
43 | ]); |
||
46 |