title: How to load an Entity from another Bundle on Symfony2
body: <p>Let's say I have two Bundles :</p>
  
  <ol>
  <li><code>Compagny\InterfaceBundle</code></li>
  <li><code>Compagny\UserBundle</code></li>
  </ol>
  
  <p>How can I load an Entity of UserBundle in the controller of InterfaceBundle ?</p>
  
  <p>The <code>Controller</code> of my <code>Compagny/InterfaceBundle</code> :</p>
  
  <pre><code>&lt;?php
  // src/Compagny/InterfaceBundle/Controller/DefaultController.php
  
  namespace Compagny\InterfaceBundle\Controller;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Compagny\UserBundle\Entity; // I believed this line will do the trick, but it doesn't
  
  class DefaultController extends Controller
  {
      public function indexAction()
      {
          $user = new User();
      }
  }
  </code></pre>
  
  <p>The <code>Entity</code> of my <code>Compagny/UserBundle</code> :</p>
  
  <pre><code>&lt;?php
  
  namespace Compagny\UserBundle\Entity
  
  class User {
   public $name;
   public function setName($name) {
    // ...
   }
   public function getName() {
    // ...
   } 
  }
  </code></pre>
  
  <p>(Let's says for this example that the User class doesn't use Doctrine2, because it doesn't need to connect to the database).</p>