From f45dda15929c7bfd8cafd21f38c66355848acb7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 13 Jul 2022 13:22:18 +0200 Subject: [PATCH] use new Model::executeCountQuery method --- src/CardDeck.php | 2 +- src/Grid.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CardDeck.php b/src/CardDeck.php index 5557df1349..fc29b1c9a6 100644 --- a/src/CardDeck.php +++ b/src/CardDeck.php @@ -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)); diff --git a/src/Grid.php b/src/Grid.php index 83f95123a0..ef82be0a62 100644 --- a/src/Grid.php +++ b/src/Grid.php @@ -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); }