1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace VideoGamesRecords\DwhBundle\Controller\Player; |
4
|
|
|
|
5
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
6
|
|
|
use Symfony\Component\HttpFoundation\Request; |
7
|
|
|
use VideoGamesRecords\DwhBundle\Repository\PlayerRepository; |
8
|
|
|
|
9
|
|
|
class GetPositions extends AbstractController |
10
|
|
|
{ |
11
|
|
|
private PlayerRepository $playerRepository; |
12
|
|
|
|
13
|
|
|
public function __construct(PlayerRepository $playerRepository) |
14
|
|
|
{ |
15
|
|
|
$this->playerRepository = $playerRepository; |
16
|
|
|
} |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @param Request $request |
20
|
|
|
* @return array |
21
|
|
|
*/ |
22
|
|
|
public function __invoke(Request $request): array |
23
|
|
|
{ |
24
|
|
|
$idPlayer = $request->query->get('idPlayer', null); |
25
|
|
|
$object = $this->playerRepository->findOneBy(array('id' => $idPlayer), array('date' => 'DESC')); |
26
|
|
|
return array( |
27
|
|
|
$object->getChartRank1(), |
28
|
|
|
$object->getChartRank2(), |
29
|
|
|
$object->getChartRank3(), |
30
|
|
|
$object->getChartRank(4), |
31
|
|
|
$object->getChartRank(5), |
32
|
|
|
$object->getChartRank(6), |
33
|
|
|
$object->getChartRank(7), |
34
|
|
|
$object->getChartRank(8), |
35
|
|
|
$object->getChartRank(9), |
36
|
|
|
$object->getChartRank(10), |
37
|
|
|
$object->getChartRank(11), |
38
|
|
|
$object->getChartRank(12), |
39
|
|
|
$object->getChartRank(13), |
40
|
|
|
$object->getChartRank(14), |
41
|
|
|
$object->getChartRank(15), |
42
|
|
|
$object->getChartRank(16), |
43
|
|
|
$object->getChartRank(17), |
44
|
|
|
$object->getChartRank(18), |
45
|
|
|
$object->getChartRank(19), |
46
|
|
|
$object->getChartRank(20), |
47
|
|
|
$object->getChartRank(21), |
48
|
|
|
$object->getChartRank(22), |
49
|
|
|
$object->getChartRank(23), |
50
|
|
|
$object->getChartRank(24), |
51
|
|
|
$object->getChartRank(25), |
52
|
|
|
$object->getChartRank(26), |
53
|
|
|
$object->getChartRank(27), |
54
|
|
|
$object->getChartRank(28), |
55
|
|
|
$object->getChartRank(29), |
56
|
|
|
$object->getChartRank(30), |
57
|
|
|
); |
58
|
|
|
} |
59
|
|
|
} |
60
|
|
|
|