Completed
Push — master ( 05fb45...272099 )
by Florian
04:05
created

ViewApiController::answerAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the feedback project.
5
 *
6
 * (c) Florian Moser <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Controller\Administration\Semester\Event;
13
14
use App\Controller\Base\BaseApiController;
15
use App\Entity\Event;
16
use App\Entity\Semester;
17
use Symfony\Component\HttpFoundation\JsonResponse;
18
use Symfony\Component\Routing\Annotation\Route;
19
20
/**
21
 * @Route("/view/api")
22
 */
23
class ViewApiController extends BaseApiController
24
{
25
    /**
26
     * @Route("/active", name="administration_semester_event_view_api_active")
27
     *
28
     * @param Event $event
29
     *
30
     * @return JsonResponse
31
     */
32
    public function activeEventAction(Event $event)
33
    {
34
        return $this->returnEvent($event);
35
    }
36
37
    /**
38
     * @Route("/{event2}/{identifier}/answers", name="administration_semester_event_view_api_active_answers")
39
     *
40
     * @throws \Exception
41
     *
42
     * @return JsonResponse
43
     */
44
    public function activeAnswersAction()
45
    {
46
        return $this->json([]);
47
    }
48
49
    /**
50
     * @Route("/semesters", name="administration_semester_event_view_api_semesters")
51
     *
52
     * @return JsonResponse
53
     */
54
    public function semestersAction()
55
    {
56
        $semesters = $this->getDoctrine()->getRepository(Semester::class)->findBy([], ['name' => 'DESC']);
57
58
        return $this->returnSemester($semesters);
59
    }
60
61
    /**
62
     * @Route("/{event2}/answer", name="administration_semester_event_view_api_event_answer")
63
     *
64
     * @throws \Exception
65
     *
66
     * @return JsonResponse
67
     */
68
    public function answerAction()
69
    {
70
        return $this->json(true);
71
    }
72
73
    /**
74
     * @Route("/{event2}/finish", name="administration_semester_event_view_api_event_finish")
75
     *
76
     * @return JsonResponse
77
     */
78
    public function finishAction()
79
    {
80
        return $this->json(true);
81
    }
82
}
83