aboutsummaryrefslogtreecommitdiff
path: root/classes/iterators
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-07-20 16:19:06 -0300
committerSilvio <silvio@devlet.com.br>2010-07-20 16:19:06 -0300
commitcf0c2004051d538b0bd6105567b3af4a87913e52 (patch)
treeb89ce752a000ecca541693ce989beddace7d34df /classes/iterators
parentd8d0a53b90de6b3184a01f1f075cdddf45e3caaa (diff)
downloadcinisis-cf0c2004051d538b0bd6105567b3af4a87913e52.tar.gz
cinisis-cf0c2004051d538b0bd6105567b3af4a87913e52.tar.bz2
New method explodeItem() at IsisConnector
Diffstat (limited to 'classes/iterators')
-rw-r--r--classes/iterators/IsisItemIterator.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/classes/iterators/IsisItemIterator.php b/classes/iterators/IsisItemIterator.php
index 2fc4780..9435146 100644
--- a/classes/iterators/IsisItemIterator.php
+++ b/classes/iterators/IsisItemIterator.php
@@ -7,8 +7,8 @@ class IsisItemIterator implements Iterator
{
private $keys;
private $fieldset;
- private $row = 0;
- private $rows = 0;
+ private $row = 0;
+ private $rows = 0;
private $item = 0;
private $items = 0;
@@ -26,18 +26,19 @@ class IsisItemIterator implements Iterator
* By default no mapping is made.
*/
public function __construct($class, $field, $main = false) {
+ // Setup.
$this->class = $class;
$this->field = $field;
$this->rows = $class->getRows($field);
- // Handle subfields
+ // Handle subfields.
$this->fieldset = $class->getSubfieldList($field);
$this->keys = array_keys($this->fieldset);
$this->items = count($this->keys);
- // Sum up main item
- $this->fieldset[] = $class->getMainItem($field);
- $this->keys[] = $class->getMainItemName($field);
+ // Sum up main item.
+ $this->fieldset['main'] = $class->getMainItemName($field);
+ $this->keys[] = 'main';
$this->items++;
}
@@ -45,7 +46,7 @@ class IsisItemIterator implements Iterator
* Rewind the Iterator to the first element.
*/
function rewind() {
- $this->row = 0;
+ $this->row = 0;
$this->item = 0;
}