From 2ae1a4c5d30c59a656756c30043ad9e0432c3bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Niedzielski?= Date: Thu, 23 Nov 2023 10:14:49 +0100 Subject: [PATCH] IBX-6634: Fixed inheritance breaking countBy --- src/contracts/Gateway/AbstractDoctrineDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contracts/Gateway/AbstractDoctrineDatabase.php b/src/contracts/Gateway/AbstractDoctrineDatabase.php index ef5c0fe..c8a9b2d 100644 --- a/src/contracts/Gateway/AbstractDoctrineDatabase.php +++ b/src/contracts/Gateway/AbstractDoctrineDatabase.php @@ -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();