title: How to write this doctrine query with multiple joins?
body: <p>I have an entity Person (p) which is related to an entity Notifications related to an entity NotificationType.</p>
  
  <ul>
  <li>Some persons have received a notification of type 1 (notification_type_id = 1).</li>
  <li>Some have received notifications but not of the type 1</li>
  <li>some haven't received messages at all.</li>
  </ul>
  
  <p>Globally, I want to retrieve those who haven't received the messages of type 1.</p>
  
  <p>I have written this query :</p>
  
  <pre><code>$qb = $this-&gt;createQueryBuilder('p')
          -&gt;leftJoin('p.notifications', 'n')
          -&gt;leftJoin('p.notification_type', 'nt')
          -&gt;addSelect(array('p','n','nt'))
          -&gt;where('nt.id NOT IN (1)')
          -&gt;orderBy('p.name', 'ASC');
  return $qb-&gt;getQuery()-&gt;getResult();
  </code></pre>
  
  <p>But with this query I only get those who have received notifications but not of type 1, I don't get those who haven't received notifications at all.</p>
  
  <p>How can I rectify my query to have those ones ?</p>
  
  <p>Thanks a lot for your help</p>