title: Symfony2 entityManager in model
body: <p>I'm going to use entity_manager in my model. But entity_manager is only available in controller: <code>throw $em = $this-&gt;get('doctrine.orm.entity_manager')</code>. So, I have to define model methods with <code>$em</code> parameter. This is making phpUnit testing pretty difficult and violates application structure. For example:</p>
  
  <pre><code>class Settings
  {
      public static function getParam( $em, $key )
      {
          $em-&gt;createQuery("
              SELECT s
              FROM FrontendBundle:Settings s
              WHERE s.param = {$key}
          ");
          return $em-&gt;getResult();
      }
  }
  </code></pre>
  
  <p>Is there any approach to use entity_manager service in model section?</p>