Completed
Pull Request — master (#45)
by Laurent
04:03
created

InventoryRepository::getInventory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 0
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