title: How to get the sql from a createQueryBuilder?
body: <p>Do you know how I can make to get the sql from my createQueryBuilder ? </p>
  
  <p>My Entity/DownloadRepository.php class:</p>
  
  <pre><code> public function getLastDownload($limit)
      {
          $query = $this-&gt;createQueryBuilder('d');
  
          $query-&gt;select('l.ytId, d.title, d.date, d.id, l.creator')
              -&gt;from('DimiYvmBundle:Log', 'l')
              -&gt;where('d.ytId = l.ytId AND l.creator = :creator')
              -&gt;orderBy('l.id', 'DESC')
              -&gt;groupBy('l.ytId')
              -&gt;setParameter('creator', 'n')
              -&gt;setMaxResults($limit);
  
          // echo $query-&gt;getSQL(); =&gt; Doesn't work... 
  
          return $query-&gt;getQuery()-&gt;getResult();
      }
  </code></pre>
  
  <p>Thanks you all for your help.
  Best regards</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>To get the sql, you have to make : </p>
  
  <pre><code>echo $query-&gt;getQuery()-&gt;getSql();
  </code></pre>
  
  <p>Thanks all !</p>