title: Constructor in Symfony2 Controller
body: <p>How can I define a constructor in Symfony2 controller. I want to get the the logged in user data available in all the methods of my controller, Currently I do something like this in every action of my controller to get the logged in user.</p>
  
  <pre><code>$em = $this-&gt;getDoctrine()-&gt;getEntityManager("pp_userdata");
  $user = $this-&gt;get("security.context")-&gt;getToken()-&gt;getUser();
  </code></pre>
  
  <p>I want to do it once in a constructor and make this logged in user available on all my actions </p>