title: Doctrine+Symfony searching for repository in wrong namespace?
body: <p>first to say I'm really new to both Symfony and Doctrine and am trying really hard to learn it. I found this tutorial <a href="http://tutorial.symblog.co.uk/" rel="nofollow">http://tutorial.symblog.co.uk/</a> which guides you through making your own blog in it. The problem is, it was designed for Symfony 2.0 and I'm using 2.1.5. So along the way I had to fix quite a few issues that occured due to changes introduced in both Symfony and Doctrine.</p>
  
  <p>However, this problem is the one I just can't seem to solve the <strong>right</strong> way. Its really short chapter, 10-15 lines of code total:</p>
  
  <p><a href="http://tutorial.symblog.co.uk/docs/customising-the-view-more-with-twig.html#recent-comments" rel="nofollow">http://tutorial.symblog.co.uk/docs/customising-the-view-more-with-twig.html#recent-comments</a></p>
  
  <p>Its actually only 1 line of code that bugs me!
  I have a PageController with an action function inside it:</p>
  
  <pre><code>public function sidebarAction()
  {
      $em = $this-&gt;getDoctrine()-&gt;getEntityManager;
  
      $blogRep = $em-&gt;getRepository('BloggerBlogBundle:Blog');
  
      //........ stuff here
  
      $em-&gt;getRepository('BloggerBlogBundle:Comment') &lt;--------------- THIS
  }
  </code></pre>
  
  <p>The damn thing just doesn't seem to work! I get the error:</p>
  
  <pre><code>Fatal error: Class 'Blogger\BlogBundle\Entity\CommentRepository' not found in /home/igor/Documents/www/igor/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php on line 689
  </code></pre>
  
  <p>Key thing! : Class 'Blogger....**Entity**</p>
  
  <p>It searches in Entity !</p>
  
  <p>My Repositories are stored in Blogger\BlogBundle\Repository namespace! 
  And the weirdest thing is, it finds 'BloggerBlogBundle:Blog' repository without problems, but doesn't find Comment!</p>
  
  <p>Both reside in same folder (Bundles\Blogger\BlogBundle\Repository) and both are declared exactly the same way:</p>
  
  <p>CommentRepository:</p>
  
  <pre><code>namespace Blogger\BlogBundle\Repository;
  
  class CommentRepository extends EntityRepository
  </code></pre>
  
  <p>BlogRepository:</p>
  
  <pre><code>namespace Blogger\BlogBundle\Repository;
  
  class BlogRepository extends EntityRepository
  </code></pre>
  
  <h2>How I managed to make it work</h2>
  
  <p>I moved CommentRepository file to "Entity" directory and changed it's namespace to Blogger\BlogBundle\Entity. It works perfectly then. No problems at all. But that way I'm stuck with repositories scattered through dirs and namespaces......</p>
  
  <p>Why does Doctrine find Blog repo and not Comment repo in Blogger\BlogBundle\Repository ?</p>