title: Symfony access entity variable from Controller
body: <p>I somehow can't get this to work. I had it working, messed up my php server &amp; had no backups from the working version... I guess I had a similar solution.</p>
  
  <pre><code>public function schreibenAction() {
    $user = $this-&gt;getDoctrine()
            -&gt;getRepository('AppBundle:User')
            -&gt;find(1); //How can I search for the currently logged user?
  
    if (!$user) {
        throw $this-&gt;createNotFoundException(
                'No user found for id 1'
        );
    }
  
    $path = $user-&gt;getPath();
    return $this-&gt;render('default/unterlagen/schreiben.html.twig', array(
                'path' =&gt; $path,
      ));
  }
  </code></pre>
  
  <p>I need the path value from the database..</p>
  
  <pre><code>SELECT t0.id AS id_1, t0.username AS username_2, t0.password AS password_3, t0.path AS path_4, t0.is_active AS is_active_5 FROM app_users t0 WHERE t0.id = ?
  </code></pre>