Skip to content

Commit

Permalink
use getCount() instead of getTotalCount() (ignores limit and offset) …
Browse files Browse the repository at this point in the history
…for BatchListing

I have read the CLA Document and I hereby sign the CLA
  • Loading branch information
hethehe committed Sep 18, 2024
1 parent 64a1070 commit 7d83b7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ public function count(): int
if (!$this->total) {
$dao = $this->list->getDao();

if (!method_exists($dao, 'getTotalCount')) {
if (!method_exists($dao, 'getCount')) {
throw new \InvalidArgumentException(sprintf('%s listing class does not support count.', $this->list::class));
}

$this->total = $dao->getTotalCount();
$this->total = $dao->getCount();
}

return $this->total;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ public function count(): int
if (!$this->total) {
$dao = $this->list->getDao();

if (!method_exists($dao, 'getTotalCount')) {
if (!method_exists($dao, 'getCount')) {
throw new \InvalidArgumentException(sprintf(
'%s listing class does not support count.',
$this->list::class,
));
}

/** @psalm-suppress InternalMethod */
$this->total = $dao->getTotalCount();
$this->total = $dao->getCount();
}

return $this->total;
Expand Down

0 comments on commit 7d83b7e

Please sign in to comment.