title: Symfony3 doctrine orm find method
body: <p>I am writing a Symfony3 appusing Doctrine ORM.</p>
  
  <p>SO what i am trying to do is to find if a given email address exists in a table (every email is unique). so i have a user repository with some attributes I can easily persist data to the db but failing to retrive data. </p>
  
  <pre><code>/**
   * @param $email
   */
  public function findUserByEmail($email)
  {
      $user = $this-&gt;getDoctrine()
          -&gt;getRepository('TestBundle:TestUser')
          -&gt;find($email);
  
      if (!$user) {
          echo 'Error';die();
      }
  }
  </code></pre>
  
  <p>I know the var passed to the function contains a email string, but what i get in return is error and when i var_dump $user before the if statment i get null.</p>
  
  <p>I followed the Symfony <a href="http://symfony.com/doc/current/doctrine.html" rel="nofollow">docs</a></p>