|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace VideoGamesRecords\CoreBundle\Controller; |
|
4
|
|
|
|
|
5
|
|
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; |
|
6
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
|
7
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
8
|
|
|
use VideoGamesRecords\CoreBundle\Entity\Group; |
|
9
|
|
|
use VideoGamesRecords\CoreBundle\Form\Type\SubmitFormFactory; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Class GroupController |
|
13
|
|
|
*/ |
|
14
|
|
|
class GroupController extends Controller |
|
15
|
|
|
{ |
|
16
|
|
|
|
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* @param Group $group |
|
20
|
|
|
* @param Request $request |
|
21
|
|
|
* @return mixed |
|
22
|
|
|
*/ |
|
23
|
|
|
public function playerRankingPoints(Group $group, Request $request) |
|
24
|
|
|
{ |
|
25
|
|
|
$maxRank = $request->query->get('maxRank', 5); |
|
26
|
|
|
$idPlayer = $request->query->get('idPlayer', null); |
|
27
|
|
|
$ranking = $this->getDoctrine()->getRepository('VideoGamesRecordsCoreBundle:PlayerGroup')->getRankingPoints($group->getId(), $maxRank, $idPlayer); |
|
28
|
|
|
return $ranking; |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @param Group $group |
|
34
|
|
|
* @param Request $request |
|
35
|
|
|
* @return mixed |
|
36
|
|
|
*/ |
|
37
|
|
|
public function playerRankingMedals(Group $group, Request $request) |
|
38
|
|
|
{ |
|
39
|
|
|
$maxRank = $request->query->get('maxRank', 5); |
|
40
|
|
|
$idPlayer = $request->query->get('idPlayer', null); |
|
41
|
|
|
$ranking = $this->getDoctrine()->getRepository('VideoGamesRecordsCoreBundle:PlayerGroup')->getRankingMedals($group->getId(), $maxRank, $idPlayer); |
|
42
|
|
|
return $ranking; |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @param Group $group |
|
48
|
|
|
* @param Request $request |
|
49
|
|
|
* @return mixed |
|
50
|
|
|
*/ |
|
51
|
|
|
public function teamRankingPoints(Group $group, Request $request) |
|
52
|
|
|
{ |
|
53
|
|
|
$maxRank = $request->query->get('maxRank', 5); |
|
54
|
|
|
$idPlayer = $request->query->get('idPlayer', null); |
|
55
|
|
|
$ranking = $this->getDoctrine()->getRepository('VideoGamesRecordsTeamBundle:TeamGroup')->getRankingPoints($group->getId(), $maxRank, $idPlayer); |
|
56
|
|
|
return $ranking; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @param Group $group |
|
62
|
|
|
* @param Request $request |
|
63
|
|
|
* @return mixed |
|
64
|
|
|
*/ |
|
65
|
|
|
public function teamRankingMedals(Group $group, Request $request) |
|
66
|
|
|
{ |
|
67
|
|
|
$maxRank = $request->query->get('maxRank', 5); |
|
68
|
|
|
$idPlayer = $request->query->get('idPlayer', null); |
|
69
|
|
|
$ranking = $this->getDoctrine()->getRepository('VideoGamesRecordsTeamBundle:TeamGroup')->getRankingMedals($group->getId(), $maxRank, $idPlayer); |
|
70
|
|
|
return $ranking; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
|
|
74
|
|
|
|
|
75
|
|
|
public function formAction($id) |
|
76
|
|
|
{ |
|
77
|
|
|
$group = $this->getDoctrine()->getRepository('VideoGamesRecordsCoreBundle:Group')->getWithGame($id); |
|
78
|
|
|
$charts = $this->getDoctrine()->getRepository('VideoGamesRecordsCoreBundle:Chart')->getFromGroupWithChartType($id); |
|
79
|
|
|
|
|
80
|
|
|
$data = [ |
|
81
|
|
|
'id' => $id, |
|
82
|
|
|
'type' => 'group', |
|
83
|
|
|
]; |
|
84
|
|
|
|
|
85
|
|
|
$data = array_merge( |
|
86
|
|
|
$data, |
|
87
|
|
|
$this->getDoctrine()->getRepository('VideoGamesRecordsCoreBundle:PlayerChartLib')->getFormValues($this->getPlayer(), null, $group) |
|
|
|
|
|
|
88
|
|
|
); |
|
89
|
|
|
|
|
90
|
|
|
$form = SubmitFormFactory::createSubmitForm( |
|
91
|
|
|
$this->get('form.factory')->create('Symfony\Component\Form\Extension\Core\Type\FormType', $data), |
|
92
|
|
|
$charts |
|
93
|
|
|
); |
|
94
|
|
|
|
|
95
|
|
|
$breadcrumbs = $this->getGroupBreadcrumbs($group); |
|
|
|
|
|
|
96
|
|
|
$breadcrumbs->addItem($group->getLibGroup()); |
|
97
|
|
|
|
|
98
|
|
|
return $this->render('VideoGamesRecordsCoreBundle:Submit:form.html.twig', ['group' => $group, 'charts' => $charts, 'form' => $form->createView()]); |
|
99
|
|
|
} |
|
100
|
|
|
} |
|
101
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.