title: Symfony custom query for $this->getUser() in controller
body: <p>Is it possible to use a <strong>custom query</strong> or maybe just <strong>modify</strong> the query builder used by Symfony when doing this?</p>
  <pre><code>public function profileAction(Request $request)
  {
      /** @var User */
      $user = $this-&gt;getUser(); // &lt;=== this
  
      return $this-&gt;getUser();
  }
  </code></pre>
  <p>I would like to modify the query builder in order to add some left joins and get additional info from the database. Something like this:</p>
  <pre><code>public function findOneByUsernameOrEmail($username)
  {
      $qb = $this-&gt;createQueryBuilder('u');
  
      return $qb
          -&gt;addSelect('c', 'ai', 'pp')
          -&gt;leftJoin('u.country', 'c')
          -&gt;leftJoin('u.avatarImage', 'ai')
          -&gt;leftJoin('u.profilePicture', 'pp')
          -&gt;where($qb-&gt;expr()-&gt;orX(
              'u.username = :username',
              'u.email = :username'
          ))
          -&gt;setParameter('username', $username)
          -&gt;getQuery()
          -&gt;getOneOrNullResult()
      ;
  }
  </code></pre>
  <p>I would like to be able to do this <strong>on demand</strong>, not every time.</p>