From 833f13ca5c2bc5a96f82388b22cf1ca5a445c07b Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 1 Jul 2010 10:54:58 -0300 Subject: Adding a non-working IsisSubfieldIterator --- classes/IsisSubfieldIterator.php | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 classes/IsisSubfieldIterator.php (limited to 'classes/IsisSubfieldIterator.php') diff --git a/classes/IsisSubfieldIterator.php b/classes/IsisSubfieldIterator.php new file mode 100644 index 0000000..ad1851d --- /dev/null +++ b/classes/IsisSubfieldIterator.php @@ -0,0 +1,51 @@ +class = $class; + $this->field = $field; + $this->subfields = $class->getSubfields($field); + $this->keys = array_values($this->subfields); + 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