Skip to content

Commit

Permalink
IBX-6634: Fixed inheritance breaking countBy
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveb-p committed Nov 23, 2023
1 parent 05c878e commit 2ae1a4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/contracts/Gateway/AbstractDoctrineDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ public function countBy($criteria): int
{
$metadata = $this->getMetadata();
$qb = $this->createBaseQueryBuilder();
$this->applyInheritance($qb);

$identifierColumn = $metadata->getIdentifierColumn();
$tableAlias = $this->getTableAlias();
$platform = $this->connection->getDatabasePlatform();
$qb->select($platform->getCountExpression($tableAlias . '.' . $identifierColumn));

$this->applyInheritance($qb);
$this->applyCriteria($qb, $criteria);

return (int)$qb->execute()->fetchOne();
Expand Down

0 comments on commit 2ae1a4c

Please sign in to comment.