aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-07-28 17:27:59 -0300
committerSilvio <silvio@devlet.com.br>2010-07-28 17:27:59 -0300
commitd95a67bf1bc97ff6eaf13e4c7d8da339b844e772 (patch)
tree448cbe8d8369437f19ec48bc8174b3ef3acb49a0
parenta4da9a28fb43366c51bbb174a1cec373c319fa89 (diff)
downloadcinisis-d95a67bf1bc97ff6eaf13e4c7d8da339b844e772.tar.gz
cinisis-d95a67bf1bc97ff6eaf13e4c7d8da339b844e772.tar.bz2
Fixing initial condition for IsisMethodIterator
-rw-r--r--classes/iterators/IsisMethodIterator.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/classes/iterators/IsisMethodIterator.php b/classes/iterators/IsisMethodIterator.php
index 4e5871c..4d2bbd4 100644
--- a/classes/iterators/IsisMethodIterator.php
+++ b/classes/iterators/IsisMethodIterator.php
@@ -8,6 +8,7 @@ class IsisMethodIterator implements Iterator
private $total = 0;
private $class;
private $keys;
+ private $position = -1;
/**
* Constructor.
@@ -16,16 +17,21 @@ class IsisMethodIterator implements Iterator
* Instance of IsisConnector or child class.
*/
public function __construct($class) {
+ // Setup.
$this->class = $class;
$this->total = count($class->fields);
$this->keys = array_keys($class->fields);
+
+ // Find the first valid occurrence.
+ $this->next();
}
/**
- * Rewind the Iterator to the first element.
+ * Rewind the Iterator to the first valid element.
*/
function rewind() {
- $this->position = 0;
+ $this->position = -1;
+ $this->next();
}
/**