Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 32 | protected function addGroupLimit($value) |
|
23 | { |
||
24 | 32 | $grammar = $this->getEagerLimitGrammar(); |
|
25 | |||
26 | 32 | $sql = $grammar->compileFirstPathSegment( |
|
27 | 32 | $this->related->qualifyColumn( |
|
28 | 32 | $this->related->getPathName() |
|
29 | ) |
||
30 | ); |
||
31 | |||
32 | 32 | $column = new Expression($sql); |
|
33 | |||
34 | 32 | $this->query->groupLimit($value, $column); |
|
35 | |||
36 | 32 | $this->query->getQuery()->addBinding( |
|
37 | 32 | array_fill( |
|
38 | 0, |
||
39 | 32 | substr_count($sql, '?'), |
|
40 | 32 | $this->related->getPathSeparator() |
|
41 | ), |
||
42 | 'groupBy' |
||
43 | ); |
||
74 |