Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.0218 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 32 | public function limit($value) |
|
18 | { |
||
19 | 32 | if ($this->parent->exists) { |
|
20 | 8 | $this->query->limit($value); |
|
21 | } else { |
||
22 | 24 | $column = $this->getExistenceCompareKey(); |
|
|
|||
23 | |||
24 | 24 | $grammar = $this->query->getQuery()->getGrammar(); |
|
25 | |||
26 | 24 | if ($grammar instanceof MySqlGrammar && $grammar->useLegacyGroupLimit($this->query->getQuery())) { |
|
27 | $column = 'pivot_'.last(explode('.', $column)); |
||
28 | } |
||
29 | |||
30 | 24 | $this->query->groupLimit($value, $column); |
|
31 | } |
||
32 | |||
33 | 32 | return $this; |
|
34 | } |
||
36 |