| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 1 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | public function sortBy($callback, $options = SORT_REGULAR, $descending = false) |
||
| 44 | { |
||
| 45 | // Included may be empty when defining the relation (on the item), |
||
| 46 | // but will be filled when using the relation to fetch the data. |
||
| 47 | // Checking if we have included items and applying the order is |
||
| 48 | // simpler then keeping track of the sorts and applying them later. |
||
| 49 | if ($this->hasIncluded()) { |
||
| 50 | $this->included = $this->getIncluded()->sortBy($callback, $options, $descending); |
||
| 51 | 9 | } |
|
| 52 | |||
| 53 | return $this; |
||
| 54 | } |
||
| 56 |