aboutsummaryrefslogtreecommitdiff
path: root/classes/IsisSubfieldIterator.php
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-07-01 14:30:21 -0300
committerSilvio <silvio@devlet.com.br>2010-07-01 14:30:21 -0300
commitd5762ebb744f5b4873e6ad779d96b694c8f0839f (patch)
tree714fe335093f63fc095546d6d5e43471d436883c /classes/IsisSubfieldIterator.php
parentb9ef6604ea1d62a1e23bed37c5a3e96b8733da97 (diff)
downloadcinisis-d5762ebb744f5b4873e6ad779d96b694c8f0839f.tar.gz
cinisis-d5762ebb744f5b4873e6ad779d96b694c8f0839f.tar.bz2
Adding IsisConnector::getRows() and minor changes
Diffstat (limited to 'classes/IsisSubfieldIterator.php')
-rw-r--r--classes/IsisSubfieldIterator.php85
1 files changed, 39 insertions, 46 deletions
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);
+ }
}