Doctrine\ORM\AbstractQuery::getSingleResult
Gets the single result of the query.
Enforces the presence as well as the uniqueness of the result. If the result is not unique, a NonUniqueResultException is thrown. If there is no result, a NoResultException is thrown.
Signature
public function getSingleResult([integer
$hydrationMode = null] )
Parameters
$hydrationMode
— integer
Returns
- mixed
Errors/Exceptions
-
NonUniqueResultException
- If the query result is not unique.
-
NoResultException
- If the query returned no result.