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

AccessLogController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getActionLogRepository() 0 3 1
A listAction() 0 6 1
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