From d5762ebb744f5b4873e6ad779d96b694c8f0839f Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 1 Jul 2010 14:30:21 -0300 Subject: Adding IsisConnector::getRows() and minor changes --- classes/IsisSubfieldIterator.php | 85 ++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 46 deletions(-) (limited to 'classes/IsisSubfieldIterator.php') diff --git a/classes/IsisSubfieldIterator.php b/classes/IsisSubfieldIterator.php index 70ff07f..4c6086b 100644 --- a/classes/IsisSubfieldIterator.php +++ b/classes/IsisSubfieldIterator.php @@ -3,50 +3,43 @@ // TODO: not working class IsisSubfieldIterator implements Iterator { - private $position = 0; - private $class; - private $field; - private $subfields; - private $keys; - - public function __construct($class, $field) - { - $this->class = $class; - $this->field = $field; - $this->subfields = $class->getSubfields($field); - $this->keys = array_values($this->subfields); - $this->total = count($this->class->result[$field['name']); - print_r($field); - } - - function subfield() - { - return $this->subfields[$this->key()]; - } - - function rewind() - { - $this->position = 0; - } - - function current() - { - $value = $this->class->getSubfield($this->field, $this->subfield()); - return $this->class->explodeValue($value); - } - - function key() - { - return $this->keys[$this->position]; - } - - function next() - { - ++$this->position; - } - - function valid() - { - return isset($this->keys[$this->position]) && ($this->current() != null); - } + private $position = 0; + private $class; + private $field; + private $subfields; + private $keys; + + public function __construct($class, $field) { + $this->class = $class; + $this->field = $field; + $this->subfields = $class->getSubfields($field); + $this->keys = array_values($this->subfields); + $this->total = count($this->class->result[$field['name']); + print_r($field); + } + + function subfield() { + return $this->subfields[$this->key()]; + } + + function rewind() { + $this->position = 0; + } + + function current() { + $value = $this->class->getSubfield($this->field, $this->subfield()); + return $this->class->explodeValue($value); + } + + function key() { + return $this->keys[$this->position]; + } + + function next() { + ++$this->position; + } + + function valid() { + return isset($this->keys[$this->position]) && ($this->current() != null); + } } -- cgit v1.2.3