title: Action parameters & Doctrine entities in Symfony 2
body: <p>We're running a project built on top of Zend Framework 1.x, and are considering moving to Symfony 2. We have a domain model mapped with Doctrine 2.</p>
  
  <p>Our (custom built) base controller class extends Zend_Controller_Action to provide a very convenient feature, inspired from Flow3:</p>
  
  <p>Let's say I have this controller:</p>
  
  <pre><code>class UserController extends BaseController
  {
      public function editAction(User $user)
      {
          // ...
      }
  }
  </code></pre>
  
  <p>If I load this URL:</p>
  
  <pre><code>/user/edit?user=123
  </code></pre>
  
  <p>The base controller will automatically load the User entity with identity 123, and pass it as a parameter to the editAction() method.
  If the user parameter is omitted, or if no User with this identity exists, an exception is thrown.</p>
  
  <p>Is there such an implementation for Symfony 2, or is it possible to implement it, and how?</p>