title: How do I access a repository from the bundle class in symfony2?
body: <p>So, I'm using the bundle class to do most of my work as I dont need controllers (src\CSFs\QuicklinksBundle\CSFsQuicklinksBundle.php).</p>
  
  <p>From the FrontController of another bundle, I get the quicklinks bundle, inject the container object into the bundle class (above) and then, within the bundle class, extract templating to return HTML, this works fine. However, I'm having trouble with repositories.</p>
  
  <pre><code>/**
   * Get the container object, so we can use all the symfony2 fun stuffs
   */
  public function injectContainer($cont) 
  {
      // Template
      $this-&gt;tpl = $cont-&gt;get('templating');
  
      // EM
      $this-&gt;em = $cont-&gt;get('doctrine')-&gt;getEntityManager();
  }
  
  /**
   *
   **/
  public function doStuff()
  {
      $products = $this-&gt;em-&gt;getRepository('QuicklinksBundle:Quicklinks')
                  -&gt;getUsersWithQuicklinks();
  }
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>Unknown Entity namespace alias 'QuicklinksBundle'.
  </code></pre>
  
  <p>I have both the generated entity file and a repository class with the getUsersWithQuicklinks() method defined.</p>
  
  <p>How do I get the entity manager to know about my repositories?</p>
  
  <p>Thanks,</p>
  
  <p>Mike</p>