Exemplo n.º 1
0
 public function __construct(AMysql_Statement $stmt)
 {
     $isValidSelectResult = $stmt->result instanceof Mysqli_Result || is_resource($stmt->result);
     if (!$isValidSelectResult) {
         throw new LogicException("Statement is not a SELECT statement. " . "Unable to iterate. Query: " . $stmt->query);
     }
     $count = $stmt->numRows();
     $this->_stmt = $stmt;
     $this->_count = $count;
 }