Home » Php » php – Doctrine 2: What does getResult return when there are no rows? null?

php – Doctrine 2: What does getResult return when there are no rows? null?

Posted by: admin July 12, 2020 Leave a comment

Questions:

I wonder what is returned by functions like get*Result(). It seems like null? Where in the docs can I find such info?

How to&Answers:

get*Result() methods return an empty array()
getSingle*Result() methods throw a \Doctrine\ORM\NoResultException

Here are direct links to the doctrine API docs

Also important exceptions:

direct links are for 2.6, but you can find there more recent versions at the at http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html