Skip to content

Commit

Permalink
pkp/pkp-lib#8700 Dropped safeCount() workaround in favor of getCountF…
Browse files Browse the repository at this point in the history
…orPagination()

(cherry picked from commit 4648a75)
  • Loading branch information
jonasraoni committed May 23, 2024
1 parent e6dc902 commit 957076e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion classes/doi/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function isAssigned(int $doiId, string $pubObjectType): bool
->getCollector()
->filterByDoiIds([$doiId])
->getQueryBuilder()
->safeCount() > 0,
->getCountForPagination() > 0,
default => false,
};

Expand Down
7 changes: 4 additions & 3 deletions classes/services/queryBuilders/GalleyQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public function getCount()
{
return $this
->getQuery()
->safeCount();
->getCountForPagination();
}

/**
* @copydoc PKP\services\queryBuilders\interfaces\EntityQueryBuilderInterface::getCount()
* @copydoc PKP\services\queryBuilders\interfaces\EntityQueryBuilderInterface::getIds()
*/
public function getIds()
{
Expand All @@ -76,7 +76,8 @@ public function getIds()
}

/**
* @copydoc PKP\services\queryBuilders\interfaces\EntityQueryBuilderInterface::getCount()
* @copydoc PKP\services\queryBuilders\interfaces\EntityQueryBuilderInterface::getQuery()
*
* @hook Galley::getMany::queryObject [[&$q, $this]]
*/
public function getQuery()
Expand Down

0 comments on commit 957076e

Please sign in to comment.