| Conditions | 4 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 78 | public function withScope($scope) |
||
| 79 | { |
||
| 80 | if ($scope == Grid\Exporter::SCOPE_ALL) { |
||
| 81 | return $this; |
||
| 82 | } |
||
| 83 | |||
| 84 | list($scope, $args) = explode(':', $scope); |
||
| 85 | |||
| 86 | if ($scope == Grid\Exporter::SCOPE_CURRENT_PAGE) { |
||
| 87 | $this->grid->model()->usePaginate(true); |
||
| 88 | } |
||
| 89 | |||
| 90 | if ($scope == Grid\Exporter::SCOPE_SELECTED_ROWS) { |
||
| 91 | $selected = explode(',', $args); |
||
| 92 | $this->grid->model()->whereIn($this->grid->getKeyName(), $selected); |
||
|
|
|||
| 93 | } |
||
| 94 | |||
| 95 | return $this; |
||
| 96 | } |
||
| 97 | |||
| 103 |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: