Conditions | 5 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function match(array $models, Collection $results, $relation) |
||
24 | { |
||
25 | parent::match($models, $results, $relation); |
||
26 | |||
27 | if (!$this->parent->exists && !$this->andSelf) { |
||
28 | $limit = $this->query->getQuery()->groupLimit; |
||
29 | |||
30 | if ($limit) { |
||
31 | foreach ($models as $model) { |
||
32 | $model->setRelation( |
||
33 | $relation, |
||
34 | $model->getRelation($relation)->take($limit['value'] - 1) |
||
35 | ); |
||
36 | } |
||
37 | } |
||
38 | } |
||
39 | |||
40 | return $models; |
||
41 | } |
||
58 |