title: Symfony2 getdoctrine outside of Model/Controller
body: <p>I'm trying to getDoctrine() outside of the controller.
  I've created this service:</p>
  
  <p>config/services.yml</p>
  
  <pre><code>services:
    update_command:
      class: project\projBundle\Command\Update
      arguments: ['@doctrine.orm.entity_manager']
  </code></pre>
  
  <p>and in my app/config/config.yml</p>
  
  <pre><code>imports:
      - { resource: "@projectprojBundle/Resources/config/services.yml" }
  </code></pre>
  
  <p>so and the class that I want to use:
  </p>
  
  <pre><code>namespace project\projBundle\Command;
  use Doctrine\ORM\EntityManager;
  
  class Update {
      protected $em;
      public function __construct(EntityManager $em) {
          $this-&gt;em = $em;
      }
  </code></pre>
  
  <p>but every time I want to do this: (<strong>I'm doing this right?</strong>)</p>
  
  <pre><code>$up = new Update();
  </code></pre>
  
  <p>i got this error:</p>
  
  <pre><code>Catchable Fatal Error: Argument 1 passed to ...\Update::__construct() must be an instance of Doctrine\ORM\EntityManager, none given, called in .../Update.php line 7  
  </code></pre>