Passed
Branch master (6e2713)
by Zangra
14:31
created

GeodisRepository::findLast()   A

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
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace GeodisBundle\Repository;
5
6
use Doctrine\ORM\EntityRepository;
7
8
class GeodisRepository extends EntityRepository
9
{
10
    public function findLast()
11
    {
12
        $qb = $this->createQueryBuilder('e');
13
        $qb->setMaxResults(1);
14
        $qb->orderBy('e.id', 'DESC');
15
16
        return $qb->getQuery()->getOneOrNullResult();
17
    }
18
}
19