diff --git a/src/Datagrid/ProxyQuery.php b/src/Datagrid/ProxyQuery.php index d22ac0f8b..70dfc7f22 100644 --- a/src/Datagrid/ProxyQuery.php +++ b/src/Datagrid/ProxyQuery.php @@ -291,8 +291,19 @@ public function getSortOrder() return $this->sortOrder; } + /** + * NEXT_MAJOR: Remove this method. + * + * @deprecated since sonata-project/doctrine-orm-admin-bundle 3.x, to be removed in 4.0. + */ public function getSingleScalarResult() { + @trigger_error(sprintf( + 'The method "%s()" is deprecated since sonata-project/doctrine-orm-admin-bundle 3.x' + .' and will be removed in version 4.0.', + __METHOD__, + ), \E_USER_DEPRECATED); + $query = $this->queryBuilder->getQuery(); return $query->getSingleScalarResult(); diff --git a/src/Datagrid/ProxyQueryInterface.php b/src/Datagrid/ProxyQueryInterface.php index d3d4eab93..0947da62a 100644 --- a/src/Datagrid/ProxyQueryInterface.php +++ b/src/Datagrid/ProxyQueryInterface.php @@ -31,7 +31,7 @@ public function getQueryBuilder(); // /** // * This method should be preferred over `$this->getQueryBuilder()->getQuery()` -// * since some changed are done to the query builder in order to handle all the +// * since some changes are done to the query builder in order to handle all the // * previously called Sonata\AdminBundle\Datagrid\ProxyQueryInterface methods. // * // * @return Query diff --git a/src/Exporter/DataSource.php b/src/Exporter/DataSource.php index 954b10cae..961658718 100644 --- a/src/Exporter/DataSource.php +++ b/src/Exporter/DataSource.php @@ -51,7 +51,7 @@ public function createIterator(BaseProxyQueryInterface $query, array $fields): S $doctrineQuery = $query->getQuery(); } } else { - // Distinct is need to iterate, even if group by is used + // Distinct is needed to iterate, even if group by is used // @see https://github.com/doctrine/orm/issues/5868 $query->getQueryBuilder()->distinct(); $query->setFirstResult(null);