title: Symfony2 doesn't seem to recognize my repository class
body: <p>I am encountering the error <strong>Undefined method 'findAllCtrs'. The method name must start with either findBy or findOneBy!</strong></p>
  
  <p>I've tried all the other solutions on StackOverflow regarding this problem. I've cleared cache, cleared meta data cache, checked the namespaces and folder entities but still no fix. </p>
  
  <p>Here is my entity:</p>
  
  <pre><code>namespace CFS\Bundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * Ref
   *
   * @ORM\Table(name="ref", indexes={@ORM\Index(name="refno", columns={"refno"}), @ORM\Index(name="ctrno", columns={"ctrno"})})
   * @ORM\Entity(repositoryClass="CFS\Bundle\Entity\RefRepository")
   */
   class Ref
  {
  </code></pre>
  
  <p>My repository class:</p>
  
  <pre><code>namespace CFS\Bundle\Entity;
  
  use Doctrine\ORM\EntityRepository;
  
  class RefRepository extends EntityRepository
  {
    public function findAllCtrs()
    {
       $query = $this-&gt;getEntityManager()
          -&gt;createQuery('
              SELECT
                  r.refno, r.ctrno
              FROM
                  CFSBundle:Ref r
              ORDER BY
                  r.refno DESC
              ');
  
      try {
          return $query-&gt;getResult();
      } catch(\Doctrine\ORM\NoResultException $e) {
          return null;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And I tried calling the method in my controller with:</p>
  
  <pre><code> $em = $this-&gt;getDoctrine()-&gt;getManager();
  
      $containers = $em-&gt;getRepository('CFSBundle:Ref')
              -&gt;findAllCtrs();
  </code></pre>
  
  <p>I did noticed that when I generate entities in the command line <code>php app/console doctrine:generate:entities CFSBundle</code> it is not recognizing my RefRepository.php file. What else could I have missed?</p>