From c5256a1063a8a2d6f41446c2b1d485f15b51a93d Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 26 Mar 2024 23:24:34 +0100 Subject: [PATCH] Update dql-doctrine-query-language.rst --- .../reference/dql-doctrine-query-language.rst | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/en/reference/dql-doctrine-query-language.rst b/docs/en/reference/dql-doctrine-query-language.rst index 84d76745930..ce06d02b81a 100644 --- a/docs/en/reference/dql-doctrine-query-language.rst +++ b/docs/en/reference/dql-doctrine-query-language.rst @@ -1026,8 +1026,8 @@ Query Result Formats (Hydration Modes) The way in which the SQL result set of a DQL SELECT query is transformed to PHP is determined by the so-called "hydration mode". -getResult() -^^^^^^^^^^^ +``getResult()`` +^^^^^^^^^^^^^^^ Retrieves a collection of objects. The result is either a plain collection of objects (pure) or an array where the objects are nested in the result rows (mixed): @@ -1052,8 +1052,8 @@ where the objects are nested in the result rows (mixed): then the previous object is used, even if the database may contain more recent data. This even happens if the previous object is still an unloaded proxy. -getArrayResult() -^^^^^^^^^^^^^^^^ +``getArrayResult()`` +^^^^^^^^^^^^^^^^^^^^ Retrieves an array graph (a nested array) for read-only purposes. @@ -1070,8 +1070,8 @@ Retrieves an array graph (a nested array) for read-only purposes. // same as: $users = $query->getResult(AbstractQuery::HYDRATE_ARRAY); -getScalarResult() -^^^^^^^^^^^^^^^^^ +``getScalarResult()`` +^^^^^^^^^^^^^^^^^^^^^ Retrieves a flat/rectangular result set of scalar values that can contain duplicate data. The pure/mixed distinction does not apply. @@ -1086,8 +1086,8 @@ pure/mixed distinction does not apply. Fields from classes are prefixed by the DQL alias in the result. A query of the kind `SELECT u.name ...` returns a key `u_name` in the result rows. -getSingleScalarResult() -^^^^^^^^^^^^^^^^^^^^^^^ +``getSingleScalarResult()`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^ Retrieves a single scalar value from the result returned by the database. If the result contains more than a single scalar value, a ``NonUniqueResultException`` is thrown. The pure/mixed distinction does not apply. @@ -1100,8 +1100,8 @@ more than a single scalar value, a ``NonUniqueResultException`` is thrown. The p // same as: $numUsers = $query->getResult(AbstractQuery::HYDRATE_SINGLE_SCALAR); -getSingleColumnResult -^^^^^^^^^^^^^^^^^^^^^ +``getSingleColumnResult()`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^ Retrieves an array from a one-dimensional array of scalar values: @@ -1113,16 +1113,16 @@ Retrieves an array from a one-dimensional array of scalar values: // same as: $ids = $query->getResult(AbstractQuery::HYDRATE_SCALAR_COLUMN); -getSingleResult -^^^^^^^^^^^^^^^ +``getSingleResult()`` +^^^^^^^^^^^^^^^^^^^^^ Retrieves a single object. If the result contains more than one object, a ``NonUniqueResultException`` is thrown. If the result contains no objects, a ``NoResultException`` is thrown. The pure/mixed distinction does not apply. -getOneOrNullResult -^^^^^^^^^^^^^^^^^^ +``getOneOrNullResult()`` +^^^^^^^^^^^^^^^^^^^^^^^^ -Retrieve a single object. If the result contains more than one object, a ``NonUniqueResultException`` +Retrieves a single object. If the result contains more than one object, a ``NonUniqueResultException`` is thrown. If no object is found, ``null`` will be returned. Custom Hydration Modes