title: How to test if Doctrine2 DQL query results in a valid result?
body: <pre><code>function search_event($parish, $genre, $pricerange)
  {
      $query = $this-&gt;em-&gt;createQuery('SELECT e from Events e WHERE e.parish = :parish AND e.genre = :genre');
      $query-&gt;setParameter('parish', $parish);
      $query-&gt;setParameter('genre', $genre);
      $result = $query-&gt;getResult();     
      return $result;
  }
  </code></pre>
  
  <p>In the example above, how do I test if $result is valid?</p>