UserRepository::findLatest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace AppBundle\Repository;
4
5
/**
6
 * VideoRepository.
7
 *
8
 * This class was generated by the Doctrine ORM. Add your own custom
9
 * repository methods below.
10
 */
11
class UserRepository extends \Doctrine\ORM\EntityRepository
12
{
13
    public function findLatest($nth)
14
    {
15
        return $this->getEntityManager()
16
            ->createQuery(
17
                'SELECT v FROM AppBundle:USER v ORDER BY v.id DESC'
18
            )
19
            ->setMaxResults($nth)->getResult();
20
    }
21
}
22