Esempio n. 1
0
 /**
  * Log potencial error and return resultset or bool true/false
  * @param bool|object $returned
  * @return bool|object
  */
 protected function returnResult($returned)
 {
     $this->lastError = false;
     if (!$returned) {
         $this->lastError = array('sql' => $this->sqlQuery, 'error' => $this->connection->error);
         return false;
     }
     // consume other resultset on multiquery
     if (!$this->isSingleQuery) {
         while ($this->connection->more_results() && $this->connection->next_result()) {
         }
     }
     if ($returned === true) {
         return new ResultSet($this->connection->affected_rows, 0);
     }
     return new ResultSet($this->connection->affected_rows, $returned->num_rows, $returned);
 }