| @@ 11-18 (lines=8) @@ | ||
| 8 | class ByUser extends Criteria { |
|
| 9 | protected $user_id; |
|
| 10 | ||
| 11 | public function __construct($user_id = null) |
|
| 12 | { |
|
| 13 | if (!is_null($user_id)) { |
|
| 14 | $this->user_id = $user_id; |
|
| 15 | } else { |
|
| 16 | $this->user_id = Auth::user()->id; |
|
| 17 | } |
|
| 18 | } |
|
| 19 | ||
| 20 | public function apply($model, Repository $repository) |
|
| 21 | { |
|
| @@ 12-19 (lines=8) @@ | ||
| 9 | ||
| 10 | protected $user_id; |
|
| 11 | ||
| 12 | public function __construct($user_id = null) |
|
| 13 | { |
|
| 14 | if (!is_null($user_id)) { |
|
| 15 | $this->user_id = $user_id; |
|
| 16 | } else { |
|
| 17 | $this->user_id = Auth::user()->id; |
|
| 18 | } |
|
| 19 | } |
|
| 20 | ||
| 21 | public function apply($model, Repository $repository) |
|
| 22 | { |
|