title: Error showing when using Custom repository in Symfony 2?
body: <p>I am new to symfony 2. I am trying to use custom repository in symfony 2. After writing the function in the detailsRepository.php file. in the controller I wrote </p>
  
  <pre><code>$em = $this-&gt;getDoctrine()-&gt;getEntityManager();
   $products = $em-&gt;getRepository('BundlesampleBundle:details')
              -&gt;findAllWhoseEmailContains($value);
  </code></pre>
  
  <p>but i am getting the error as</p>
  
  <blockquote>
    <p>Warning: Missing argument 1 for Doctrine\ORM\EntityRepository::__construct(), called in C:\xampp\htdocs\symblog\src\Bundle\sampleBundle\Controller\DefaultController.php on line 162 and defined in C:\xampp\htdocs\symblog\vendor\doctrine\lib\Doctrine\ORM\EntityRepository.php line 61 (500 Internal Server Error)</p>
  </blockquote>
  
  <p>My detailsRepository.php is as follows</p>
  
  <pre><code>&lt;?php
  
  namespace Bundle\sampleBundle\Entity;
  
  use Doctrine\ORM\EntityRepository;
  
  /**
   * detailsRepository
   *
   * This class was generated by the Doctrine ORM. Add your own custom
   * repository methods below.
   */
  
  class detailsRepository extends EntityRepository
  {
      public function findAllWhoseEmailContains($value)
      {
          return $this-&gt;getEntityManager()
              -&gt;createQuery('Select e.email from BundlesampleBundle:details e Where  e.email = :email')
              -&gt;setParameter('email',$value)
              -&gt;getResult();
  
  
      }   
  
  }
  </code></pre>
  
  <p>Thanks in advance.</p>