I wonder what 开发者_StackOverflowis returned by functions like get*Result()
. It seems like null? Where in the docs can I find such info?
get*Result()
methods return an empty array()
getSingle*Result()
methods throw a \Doctrine\ORM\NoResultException
Here are direct links to the doctrine API docs
getResult()
doctrine API docsgetSingleResult()
doctrine API docsgetSingleScalarResult()
doctrine API docsgetOneOrNullResult()
doctrine API docs
Also important exceptions:
NoResultException
doctrine API docsNonUniqueResultException
doctrine API docs(must handle for
getSingle*()
andgetOneOrNullResult()
methods)UnexpectedResultException
doctrine API docs (this is parent exception of the two above)
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
精彩评论