Having   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A modify() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Happyr Doctrine Specification package.
5
 *
6
 * (c) Tobias Nyholm <[email protected]>
7
 *     Kacper Gunia <[email protected]>
8
 *     Peter Gribanov <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Happyr\DoctrineSpecification\Query;
15
16
use Doctrine\ORM\QueryBuilder;
17
use Happyr\DoctrineSpecification\Filter\Filter;
18
19
class Having implements QueryModifier
20
{
21
    /**
22
     * @var Filter
23
     */
24
    private $filter;
25
26
    /**
27
     * @param Filter $filter
28
     */
29
    public function __construct(Filter $filter)
30
    {
31
        $this->filter = $filter;
32
    }
33
34
    /**
35
     * @param QueryBuilder $qb
36
     * @param string       $dqlAlias
37
     */
38
    public function modify(QueryBuilder $qb, $dqlAlias)
39
    {
40
        $qb->having($this->filter->getFilter($qb, $dqlAlias));
41
    }
42
}
43