// Call parent constructor
parent::__construct(__CLASS__);
- // Set part description
- $this->setObjectDescription("Database result");
-
- // Create unique ID number
- $this->generateUniqueId();
-
// Clean up a little
$this->removeNumberFormaters();
$this->removeSystemArray();
$nextValid = false;
// Is the result valid?
- if ($this->resultArray['status'] === "ok") {
- // The status is fine so let's have a look for the next entry
- if ($this->valid()) {
- // Next entry found, so count one up and cache it
- $this->currentPos++;
- $this->currentRow = $this->resultArray['rows'][$this->currentPos];
- $nextValid = true;
- } // END - if
+ if ($this->valid()) {
+ // Next entry found, so count one up and cache it
+ $this->currentPos++;
+ $this->currentRow = $this->resultArray['rows'][$this->currentPos];
+ $nextValid = true;
} // END - if
// Return the result
$isValid = false;
// Check if
- if ((isset($this->resultArray['rows'][($this->currentPos + 1)])) && (isset($this->resultArray['rows'][0]))) {
+ if (($this->ifStatusIsOkay()) && (isset($this->resultArray['rows'][($this->currentPos + 1)])) && (isset($this->resultArray['rows'][0]))) {
// All fine!
$isValid = true;
} // END - if
return $isValid;
}
+ /**
+ * Determines wether the status of the query was fine ("ok")
+ *
+ * @return $ifStatusOkay Wether the status of the query was okay
+ */
+ public function ifStatusIsOkay () {
+ return ((isset($this->resultArray['status'])) && ($this->resultArray['status'] === "ok"));
+ }
+
/**
* Gets the current key of iteration
*