Skip to content

Commit e087db7

Browse files
author
Michael Deck
committed
Fix issues with update to get method
1 parent 912e97d commit e087db7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Database/Eloquent/FMEloquentBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class FMEloquentBuilder extends Builder
2222
*/
2323
public function get($columns = ['*'])
2424
{
25-
$records = $this->tobase()->get();
26-
$models = $this->model->createModelsFromRecordSet($records);
25+
$records = $this->toBase()->get();
26+
$models = $this->model->createModelsFromRecordSet(collect($records));
2727

2828
// If we actually found models we will also eager load any relationships that
2929
// have been specified as needing to be eager loaded, which will solve the
@@ -258,7 +258,7 @@ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page',
258258

259259
$perPage = $perPage ?: $this->model->getPerPage();
260260

261-
$response = $this->forPage($page, $perPage)->getData();
261+
$response = $this->forPage($page, $perPage)->toBase()->getData();
262262

263263
$total = Arr::get($response, 'response.dataInfo.foundCount', 0);
264264
$results = $this->model->createModelsFromRecordSet(

src/Database/Query/FMBaseBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public function get($columns = ['*'])
420420
return $records;
421421
}
422422

423-
protected function getData()
423+
public function getData()
424424
{
425425
$this->computeWhereIns();
426426

0 commit comments

Comments
 (0)