title: Doctrine - select a NULL value from db
body: <p>I have a class, let's say Test.php. This class has an id, a description, a code, and a discount percentage. </p>
  
  <p>This code returns an object:</p>
  
  <pre><code>$test = $this-&gt;getDoctrine()-&gt;getRepository('\UserBundle\Entity\Test')-&gt;findOneBy(array('code' =&gt; 12345 ));
  </code></pre>
  
  <p>This code, instead, doesn't return an object:</p>
  
  <pre><code>$test = $this-&gt;getDoctrine()-&gt;getRepository('\UserBundle\Entity\Test')-&gt;findOneBy(array('code' =&gt; null ));
  </code></pre>
  
  <p>The code field is NULL by default.</p>
  
  <p>Any suggestion? Thanks!</p>