Completed
Push — master ( 2fdc18...f6fd2e )
by Laurent
03:47
created

InventoryRepository::getLastInventory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 10
rs 9.4285
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\EntityRepository;
6
7
/**
8
 * InventoryRepository
9
 *
10
 * This class was generated by the Doctrine ORM. Add your own custom
11
 * repository methods below.
12
 */
13
class InventoryRepository extends EntityRepository
14
{
15
    /**
16
     * Affiche les inventaires actifs.
17
     *
18
     * @return QueryBuilder Requête DQL
19
     */
20
    public function getInventory()
21
    {
22
        $query = $this->createQueryBuilder('i')
23
            ->where('i.status > 0')
24
            ->orderBy('i.id', 'DESC')
25
            ->getQuery();
26
        
27
        return $query->getResult();
28
    }
29
30
    public function getLastInventory($count)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
31
    {
32
        $query = $this->createQueryBuilder('i')
33
            ->where('i.status > 0')
34
            ->orderBy('i.id', 'DESC')
35
            ->setMaxResults($count)
36
            ->getQuery();
37
38
        return $query->getResult();
39
    }
40
}
41