diff options
author | Silvio <silvio@devlet.com.br> | 2010-07-06 19:39:43 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2010-07-06 19:39:43 -0300 |
commit | ffa45903b951f08df999bfd74a70a813852f8419 (patch) | |
tree | 5d1a7d0dd6a5a31f4ba0ad280eaae2d70f37c41e /classes | |
parent | e1de29a6695b266bf4ad3c517cb271593173ee2b (diff) | |
download | cinisis-ffa45903b951f08df999bfd74a70a813852f8419.tar.gz cinisis-ffa45903b951f08df999bfd74a70a813852f8419.tar.bz2 |
Cleanup on IsisValueIterator
Diffstat (limited to 'classes')
-rw-r--r-- | classes/IsisValueIterator.php | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/classes/IsisValueIterator.php b/classes/IsisValueIterator.php index 04b3d92..f10125d 100644 --- a/classes/IsisValueIterator.php +++ b/classes/IsisValueIterator.php @@ -6,12 +6,9 @@ */ class IsisValueIterator implements Iterator { - private $keys; private $valueset; private $row = 0; private $rows = 0; - private $value = 0; - private $values = 0; /** * Constructor. @@ -25,8 +22,6 @@ class IsisValueIterator implements Iterator public function __construct($class, $field) { $this->rows = $class->getRows($field); $this->valueset = $class->getValues($field); - $this->keys = array_keys($this->valueset); - $this->values = count($this->keys); } /** @@ -48,20 +43,14 @@ class IsisValueIterator implements Iterator * Return the current element. */ function current() { - return $this->valueset[$this->keys[$this->value]]; + return $this->valueset[$this->row]; } /** * Move forward to next element. */ function next() { - if ($this->value >= $this->values) { - $this->value = 0; - ++$this->row; - } - else { - ++$this->value; - } + ++$this->row; } /** |