Passed
Push — implement_memcached_sessions ( 6ecce1 )
by Paweł
58:27 queued 27:27
created

WidgetModelRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
c 1
b 1
f 0
lcom 0
cbo 2
dl 0
loc 32
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getById() 0 10 1
A getAll() 0 6 1
1
<?php
2
3
/**
4
 * This file is part of the Superdesk Web Publisher Template Engine Bundle.
5
 *
6
 * Copyright 2015 Sourcefabric z.u. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2015 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\TemplateEngineBundle\Repository;
16
17
use Doctrine\ORM\EntityRepository;
18
19
/**
20
 * Container Repository.
21
 */
22
class WidgetModelRepository extends EntityRepository
23
{
24
    /**
25
     * Get Query for WidgetModel searched by id.
26
     *
27
     * @param string $id
28
     *
29
     * @return \Doctrine\ORM\Query
30
     */
31 5
    public function getById($id)
32
    {
33 5
        $qb = $this->createQueryBuilder('w')
34 5
            ->where('w.id = :id')
35 5
            ->setParameters([
36 5
                'id' => $id,
37
            ]);
38
39 5
        return $qb->getQuery();
40
    }
41
42
    /**
43
     * Get Query for all WidgetModels.
44
     *
45
     * @return \Doctrine\ORM\Query
46
     */
47 1
    public function getAll()
48
    {
49 1
        $qb = $this->createQueryBuilder('w');
50
51 1
        return $qb->getQuery();
52
    }
53
}
54