title: symfony2 Class sub class of "Doctrine\ORM\EntityRepository" is not a valid entity or mapped super class
body: <pre><code>namespace griffin\UserBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  /**
   * @ORM\Entity(repositoryClass="griffin\UserBundle\Entity\UserRepository")
   * @ORM\Table(name="users")
   */
  class User {
  
      const STATUS_ACTIVE   = 1;
      const STATUS_INACTIVE = 0;
  
      /**
       * @ORM\Id
       * @ORM\Column(name="id_users", type="smallint")
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $idUsers;
  </code></pre>
  
  <p>And Repository class like</p>
  
  <pre><code>namespace griffin\UserBundle\Entity;
  use Doctrine\ORM\EntityRepository;
  
  class UserRepository extends EntityRepository {
  
      public function getAdmin()
      {
          return $this-&gt;getEntityManager()
                  -&gt;createQuery('select * from users where users_groups_id = 1')
                  -&gt;getResults;
      }
  }
  </code></pre>
  
  <p>And when I call it in my controller</p>
  
  <pre><code>$results = $this-&gt;getDoctrine()
      -&gt;getRepository('griffin\UserBundle\Entity\UserRepository')
      -&gt;getAdmin();
  
  var_dump($results);
  </code></pre>
  
  <p>I got error 
  <code>Class "griffin\UserBundle\Entity\UserRepository" sub class of "Doctrine\ORM\EntityRepository" is not a valid entity or mapped super class.</code></p>