Offset::modify()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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
18
class Offset implements QueryModifier
19
{
20
    /**
21
     * @deprecated This property will be marked as private in 2.0.
22
     *
23
     * @var int offset
24
     */
25
    protected $offset;
26
27
    /**
28
     * @param int $offset
29
     */
30
    public function __construct($offset)
31
    {
32
        $this->offset = $offset;
0 ignored issues
show
Deprecated Code introduced by
The property Happyr\DoctrineSpecification\Query\Offset::$offset has been deprecated with message: This property will be marked as private in 2.0.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
33
    }
34
35
    /**
36
     * @param QueryBuilder $qb
37
     * @param string       $dqlAlias
38
     */
39
    public function modify(QueryBuilder $qb, $dqlAlias)
40
    {
41
        $qb->setFirstResult($this->offset);
0 ignored issues
show
Deprecated Code introduced by
The property Happyr\DoctrineSpecification\Query\Offset::$offset has been deprecated with message: This property will be marked as private in 2.0.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
42
    }
43
}
44