title: Doctrine QueryBuilder undefined method getQuery()
body: <p>When I execute the method <strong>getMachineSettings</strong> I get an error:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught Error: Call to undefined method Doctrine\DBAL\Query\QueryBuilder::getQuery()</p>
  </blockquote>
  
  <p><code>$data</code> is an associative array:</p>
  
  <pre><code>$data['param'] = 'ip';
  $data['value'] = '192.168.240.10';
  </code></pre>
  
  <p>If I replace <code>getQuery()-&gt;getResult()</code> with <code>execute()</code>, <code>$result</code> contains the query:</p>
  
  <p><code>SELECT * FROM machine WHERE ip = ?</code></p>
  
  <pre><code>public function __construct()
  {
  
      try
      {
  
          $dbconf = parse_ini_file('.htLogin.ini');
          $config = new \Doctrine\DBAL\Configuration();
  
          $connectionParams = array
              (
                  'dbname'    =&gt; $dbconf['infoDb'],
                  'user'      =&gt; $dbconf['infoLogin'],
                  'password'  =&gt; $dbconf['infoPw'],
                  'host'      =&gt; $dbconf['infoHost'],
                  'driver'    =&gt; 'pdo_mysql',
                  'charset'   =&gt; 'utf8',
                  'driverOptions' =&gt; array
                      (
                          PDO::MYSQL_ATTR_INIT_COMMAND =&gt; 'SET NAMES utf8'
                      )
  
              );
          $this-&gt;mysql = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
  
      }
      catch(PDOException $e)
      {
  
          echo $e -&gt; getMessage();
  
      }
  
  
  public function getMachineSettings($data)
  {
      $qb = $this-&gt;mysql-&gt;createQueryBuilder();
      $qb-&gt;SELECT('*')
         -&gt;FROM('`machine`')
         -&gt;WHERE($data['param'] . ' = :value');
      $qb-&gt;setParameters(
              array
              (
                  ':value' =&gt; $data['value']
              )
          );
  
      $results = $qb-&gt;getQuery()-&gt;getResult();
  
  
      var_dump($result);
  
      return $result;
  
   }
  </code></pre>
  
  <p>Do you have any idea why the method <code>getQuery()</code> is not recognised?</p>