From d1ba6eb119236ba38c50b07c75d5ff433f5221d6 Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 1 Jul 2010 15:30:54 -0300 Subject: Updating comments --- classes/IsisSubfieldIterator.php | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/classes/IsisSubfieldIterator.php b/classes/IsisSubfieldIterator.php index 4c6086b..6f70d87 100644 --- a/classes/IsisSubfieldIterator.php +++ b/classes/IsisSubfieldIterator.php @@ -1,6 +1,11 @@ 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); } + /** + * Get the current subfield. + */ function subfield() { return $this->subfields[$this->key()]; } + /** + * Rewind the Iterator to the first element. + */ function rewind() { $this->position = 0; } + /** + * Return the current element. + */ function current() { $value = $this->class->getSubfield($this->field, $this->subfield()); return $this->class->explodeValue($value); } + /** + * Return the key of the current element. + */ function key() { return $this->keys[$this->position]; } + /** + * Move forward to next element. + */ function next() { ++$this->position; } + /** + * Check if there is a current element after calls to rewind() or next(). + */ function valid() { return isset($this->keys[$this->position]) && ($this->current() != null); } -- cgit v1.2.3