Skip to content

Commit

Permalink
pkp/pkp-lib#8700 Updated code to make use of the new safeCount() macro
Browse files Browse the repository at this point in the history
(cherry picked from commit 0dc0b39)
  • Loading branch information
jonasraoni committed May 30, 2024
1 parent 908e7f7 commit 56e0ebc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions classes/doi/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ public function isAssigned(int $doiId, string $pubObjectType): bool
Repo::doi()::TYPE_REPRESENTATION => Repo::galley()
->getCollector()
->filterByDoiIds([$doiId])
->getIds()
->count(),
->getQueryBuilder()
->safeCount() > 0,
default => false,
};

Expand Down
4 changes: 1 addition & 3 deletions classes/services/queryBuilders/GalleyQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ public function getCount()
{
return $this
->getQuery()
->select('g.galley_id')
->get()
->count();
->safeCount();
}

/**
Expand Down

0 comments on commit 56e0ebc

Please sign in to comment.