title: Symfony : Customer query for load user
body: <p>With Symfony 3.3 and Twig, when I call " app.user ", this query is loaded :</p>
  
  <pre><code>SELECT
      t0.id AS id_1,
      t0.username AS username_2,
      t0.email AS email_3,
      t0.password AS password_4,
      ...
  FROM
      user t0
  WHERE
      t0.id = ?
  </code></pre>
  
  <p>Can I override this query, for add a join and parameters in Where ?</p>
  
  <p>I see this : <a href="https://symfony.com/doc/current/security/entity_provider.html#using-a-custom-query-to-load-the-user" rel="nofollow noreferrer">Using a Custom Query to Load the User</a></p>
  
  <p><strong>This is not my situation :</strong> <em>loadUserByUsername()</em> load with username or email (<strong>u.username = :username OR u.email = :email</strong>), twig make a query with Id (<strong>t0.id = ?</strong>)</p>
  
  <p>Thanks :)</p>