Completed
Push — master ( 5e4f38...1af8b6 )
by Laurent
08:07 queued 04:24
created

MaterialRepository::getItems()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/**
4
 * Entité Material.
5
 *
6
 * PHP Version 5
7
 *
8
 * @author    Quétier Laurent <[email protected]>
9
 * @copyright 2014 Dev-Int GLSR
10
 * @license   http://opensource.org/licenses/gpl-license.php GNU Public License
11
 *
12
 * @version GIT: <git_id>
13
 *
14
 * @link https://github.com/Dev-Int/glsr
15
 */
16
namespace AppBundle\Repository\Config;
17
18
use Doctrine\ORM\EntityRepository;
19
20
/**
21
 * MaterialRepository
22
 *
23
 * @category Entity
24
 */
25
class MaterialRepository extends EntityRepository
26
{
27
    /**
28
     * Affiche les matières.
29
     *
30
     * @return QueryBuilder Requête DQL
31
     */
32
    public function getAllItems()
33
    {
34
        $query = $this->createQueryBuilder('m')
35
            ->join('m.articles', 'a')
36
            ->addSelect('a')
37
            ->join('m.unitStorage', 'u')
38
            ->addSelect('u')
39
        ;
40
        
41
        return $query;
42
    }
43
44
    /**
45
     * Affiche les matières actives.
46
     *
47
     * @return QueryBuilder Requête DQL
48
     */
49
    public function getItems()
50
    {
51
        $query = $this->getAllItems();
52
        
53
        return $query;
54
    }
55
}
56