Completed
Push — master ( 860e6f...c234e1 )
by Jared
02:12
created

Limit::limit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace JAQB\Query\Traits;
4
5
trait Limit
6
{
7
    /**
8
     * @var JAQB\Statement\LimitStatement
9
     */
10
    protected $limit;
11
12
    /**
13
     * Sets the limit for the query.
14
     *
15
     * @param int $limit
16
     * @param int $offset
17
     *
18
     * @return self
19
     */
20
    public function limit($limit, $offset = 0)
21
    {
22
        $this->limit->setLimit($limit, $offset);
23
24
        return $this;
25
    }
26
27
    /**
28
     * Gets the limit statement for the query.
29
     *
30
     * @return LimitStatement
31
     */
32
    public function getLimit()
33
    {
34
        return $this->limit;
35
    }
36
}
37