Completed
Push — sf2.7 ( 8586ff...27ae11 )
by Laurent
03:38
created

getArticlesFromInventory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
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 8
rs 9.4285
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\EntityRepository;
6
use AppBundle\Entity\Inventory;
7
8
/**
9
 * InventoryArticlesRepository
10
 *
11
 * This class was generated by the Doctrine ORM. Add your own custom
12
 * repository methods below.
13
 */
14
class InventoryArticlesRepository extends EntityRepository
15
{
16
    public function getArticlesFromInventory(Inventory $inventory) {
17
        $query = $this->createQueryBuilder('i')
18
            ->where('i.inventory = :id')
19
            ->setParameter('id', $inventory->getId())
20
            ->getQuery();
21
        
22
        return $query->getResult();
23
    }
24
}
25