@@ 47-60 (lines=14) @@ | ||
44 | * @param int $offset |
|
45 | * @return \Illuminate\Support\Collection |
|
46 | */ |
|
47 | public function get($criteria = [], $columns = ['*'], $limit = null, $offset = null) |
|
48 | { |
|
49 | $model = $this->match($criteria); |
|
50 | ||
51 | if (is_null($limit) === false) { |
|
52 | $model = $model->take($limit); |
|
53 | } |
|
54 | ||
55 | if (is_null($offset) === false) { |
|
56 | $model = $model->skip($offset); |
|
57 | } |
|
58 | ||
59 | return $model->keyBy($this->primaryKey); |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * paginate. |
@@ 35-48 (lines=14) @@ | ||
32 | * @param int $offset |
|
33 | * @return \Illuminate\Support\Collection |
|
34 | */ |
|
35 | public function get($criteria = [], $columns = ['*'], $limit = null, $offset = null) |
|
36 | { |
|
37 | $model = $this->match($criteria); |
|
38 | ||
39 | if (is_null($limit) === false) { |
|
40 | $model = $model->take($limit); |
|
41 | } |
|
42 | ||
43 | if (is_null($offset) === false) { |
|
44 | $model = $model->skip($offset); |
|
45 | } |
|
46 | ||
47 | return $model->get($columns); |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * paginate. |