Commit 344ee8f8 authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

Add pagination for overrides

parent c6498f46
......@@ -3,16 +3,19 @@
namespace Source\UseCases\Overrides;
use Source\Entities\Override;
use Source\Sanitize\Paginates;
use Source\UseCases\BasePresenter;
class ApiPresenter extends BasePresenter implements Presenter
{
protected array $viewModel = [];
use Paginates;
protected array $overrides = [];
/** @inheritDoc */
public function present(ResponseModel $responseModel): void
{
$this->viewModel['overrides'] = array_map(function (Override $override) {
$this->overrides = array_map(function (Override $override) {
return $this->formatOverride($override);
}, $responseModel->getOverrides());
}
......@@ -20,6 +23,6 @@ class ApiPresenter extends BasePresenter implements Presenter
/** @inheritDoc */
public function getViewModel(): array
{
return $this->viewModel;
return $this->paginate($this->overrides);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment