Skip to content

Commit

Permalink
Merge pull request #10 from jvitasek/master
Browse files Browse the repository at this point in the history
Added Paginator getter, fixed when no presenter is attached
  • Loading branch information
aleswita committed Apr 6, 2021
2 parents 34f0dee + 1ce476b commit ed0ebfd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/VisualPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ public function getItemsPerPage(): int
return $this->paginator->getItemsPerPage();
}

public function getPaginator(): Paginator
{
return $this->paginator;
}

/**
* @param array<mixed> $params
*/
Expand Down Expand Up @@ -167,7 +172,13 @@ private function getSessionRepository(): string
}

if ($repository === null) {
$repository = $this->presenter->getName() ?? 'default';
$presenter = $this->getPresenterIfExists();

if ($presenter !== null) {
$repository = $presenter->getName() ?? 'default';
} else {
$repository = 'default';
}
}

return Strings::lower($repository);
Expand Down

0 comments on commit ed0ebfd

Please sign in to comment.