Coderwall
Ruby Python JavaScript Front-End Tools iOS
More Tips
Ruby Python JavaScript Front-End Tools iOS PHP Android .NET Java Jobs
Jobs
Sign In or Up
Last Updated: February 25, 2016
·
30.1K
· andreia

Doctrine: get single row or null

#doctrine2
$query->getOneOrNullResult();
  • no result: return null
  • more than one result: throw an NonUniqueResultException exception

http://doctrine-orm.readthedocs.org/en/latest/reference/dql-doctrine-query-language.html#query-result-formats

https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/AbstractQuery.php#L763

#doctrine2

Written by Andréia Bohner

Say Thanks
Respond

Related protips

Defining a column to be the key of the result hydrated as array in Doctrine 2

11.31K
0

How to configure Doctrine 2 with CodeIgniter PHP

10.64K
3

Using QueryBuilder and single table inheritance

6.939K
1

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Best #Doctrine2 Authors
andreia
47.46K
#doctrine2
#jQuery
#Symfony2
joseluisq
10.64K
#doctrine2
#Javascript
#CSS
hasumedic
6.938K
#doctrine2
#symfony2
#jquery
damienalexandre
6.198K
#doctrine2
#symfony
#PHP
xfornesa
3.698K
#doctrine2
#Puppet
#Open Source
Related Tags
#doctrine2
Sponsored by
#native_company#
#native_desc#
#native_cta#
Awesome Job
See All Jobs

Post a job for only $299
Thanks to our sponsor
Sponsored by #native_company# — Learn More
#native_title# #native_desc#
#native_cta#
@coderwall
APM product comparisons Contact Privacy Terms

Copyright 2025

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.