Skip to content

Commit

Permalink
use new Model::executeCountQuery method
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jul 13, 2022
1 parent a0cfd09 commit f45dda1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CardDeck.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ private function getModelActions(string $appliesTo): array
*/
protected function initPaginator()
{
$count = (int) $this->model->action('count')->getOne();
$count = $this->model->executeCountQuery();
if ($this->paginator) {
if ($count > 0) {
$this->paginator->setTotal((int) ceil($count / $this->ipp));
Expand Down
2 changes: 1 addition & 1 deletion src/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ public function addDragHandler()
*/
private function setModelLimitFromPaginator()
{
$this->paginator->setTotal((int) ceil((int) $this->model->action('count')->getOne() / $this->ipp));
$this->paginator->setTotal((int) ceil($this->model->executeCountQuery() / $this->ipp));
$this->model->setLimit($this->ipp, ($this->paginator->page - 1) * $this->ipp);
}

Expand Down

0 comments on commit f45dda1

Please sign in to comment.