Failed Conditions
Branch issue#666 (91903a)
by Guilherme
08:25
created

AccessLogController::getActionLogRepository()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace LoginCidadao\CoreBundle\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
8
use LoginCidadao\APIBundle\Entity\ActionLogRepository;
9
10
class AccessLogController extends Controller
11
{
12
13
    /**
14
     * @Route("/logins/list", name="lc_access_log_list")
15
     * @Template()
16
     */
17
    public function listAction()
18
    {
19
        $repo = $this->getActionLogRepository();
20
        $logs = $repo->findLoginsByPerson($this->getUser(), 50);
21
22
        return compact('logs');
23
    }
24
25
    /**
26
     * @return ActionLogRepository
27
     */
28
    private function getActionLogRepository()
29
    {
30
        return $this->getDoctrine()->getRepository('LoginCidadaoAPIBundle:ActionLog');
31
    }
32
}
33