1 | <?php |
||
30 | class ProfilesController extends Controller |
||
31 | { |
||
32 | /** |
||
33 | * Renders profiles page. |
||
34 | * |
||
35 | * @param Request $request |
||
36 | * |
||
37 | * @return Response |
||
38 | */ |
||
39 | public function listAction(Request $request) |
||
46 | |||
47 | /** |
||
48 | * Returns a json list of profiles |
||
49 | * |
||
50 | * @param Request $request |
||
51 | * |
||
52 | * @return Response |
||
53 | */ |
||
54 | public function getAllProfilesAction(Request $request) |
||
55 | { |
||
56 | $profiles = []; |
||
57 | $repo = $this->get($this->getParameter('ongr_settings.repo')); |
||
58 | |||
59 | /** @var DocumentIterator $result */ |
||
60 | $result = $repo->execute( |
||
61 | (new Search())->addAggregation(new TermsAggregation('profiles', 'profile')) |
||
62 | ); |
||
63 | /** @var AggregationValue $agg */ |
||
64 | foreach ($result->getAggregation('profiles') as $agg) { |
||
65 | $profiles[] = $agg->getValue('key'); |
||
66 | } |
||
67 | |||
68 | if (empty($profiles)) $profiles[] = 'default'; |
||
69 | |||
70 | return new JsonResponse($profiles); |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * Returns a json list of profiles |
||
75 | * |
||
76 | * @return Response |
||
77 | */ |
||
78 | public function getFullProfilesAction() |
||
86 | |||
87 | public function toggleProfileAction(Request $request) |
||
115 | } |
||
116 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.