Completed
Push — master ( 88ba9b...8a3d51 )
by Andrii
03:03
created

Query::apply()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 12
ccs 0
cts 4
cp 0
rs 9.4285
cc 3
eloc 6
nc 4
nop 1
crap 12
1
<?php
2
3
namespace hiapi\query;
4
5
class Query extends \yii\db\Query
6
{
7
    public function apply(Specification $specification)
8
    {
9
        if ($specification->where) {
10
            $this->andWhere($specification->where);
11
        }
12
13
        if ($specification->limit) {
14
            $this->limit($specification->limit);
15
        }
16
17
        return $this;
18
    }
19
}
20