Skip to content

Commit

Permalink
Update dql-doctrine-query-language.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasLandauer authored Mar 26, 2024
1 parent 78f03ce commit c5256a1
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions docs/en/reference/dql-doctrine-query-language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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.

Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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:

Expand All @@ -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
Expand Down

0 comments on commit c5256a1

Please sign in to comment.