diff --git a/docs/en/reference/dql-doctrine-query-language.rst b/docs/en/reference/dql-doctrine-query-language.rst index 024d1b38f77..140d558b336 100644 --- a/docs/en/reference/dql-doctrine-query-language.rst +++ b/docs/en/reference/dql-doctrine-query-language.rst @@ -1304,14 +1304,13 @@ creating a class which extends ``AbstractHydrator``: _stmt->fetchAll(FetchMode::FETCH_ASSOC); + return $this->_stmt->fetchAllAssociative(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php b/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php index fb497deea6a..b8aae160788 100644 --- a/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php +++ b/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php @@ -36,7 +36,7 @@ public function assertForeignKeysNotContain($firstId, $secondId): void protected function countForeignKeys($firstId, $secondId): int { - return count($this->_em->getConnection()->executeQuery(sprintf( + return count($this->_em->getConnection()->fetchAllAssociative(sprintf( <<<'SQL' SELECT %s FROM %s @@ -48,7 +48,7 @@ protected function countForeignKeys($firstId, $secondId): int $this->table, $this->firstField, $this->secondField - ), [$firstId, $secondId])->fetchAll()); + ), [$firstId, $secondId])); } public function assertCollectionEquals(Collection $first, Collection $second): bool