code: public function query($sql)
      {
          $rows = array();
          foreach ($this->getConnection()->query($sql) as $row) {
              $rows[] = $row;
          }
  
          return $rows;
      }
docs: Execute sql and expect return a data.
  
  @param string $sql Sql query.
  
  @return array