aboutsummaryrefslogtreecommitdiff
path: root/classes/iterators
diff options
context:
space:
mode:
Diffstat (limited to 'classes/iterators')
-rw-r--r--classes/iterators/IsisFieldIterator.php3
-rw-r--r--classes/iterators/IsisMainFieldIterator.php7
2 files changed, 6 insertions, 4 deletions
diff --git a/classes/iterators/IsisFieldIterator.php b/classes/iterators/IsisFieldIterator.php
index 09f4867..26c5e88 100644
--- a/classes/iterators/IsisFieldIterator.php
+++ b/classes/iterators/IsisFieldIterator.php
@@ -27,9 +27,6 @@ class IsisFieldIterator implements Iterator
* @param $main
* Control to which subfield the main field should be mapped to.
* By default no mapping is made.
- *
- * @todo
- * Implement $main mapping.
*/
public function __construct($class, $field, $main = false) {
$this->class = $class;
diff --git a/classes/iterators/IsisMainFieldIterator.php b/classes/iterators/IsisMainFieldIterator.php
index 68430b8..5ec1cbc 100644
--- a/classes/iterators/IsisMainFieldIterator.php
+++ b/classes/iterators/IsisMainFieldIterator.php
@@ -9,6 +9,8 @@
*/
class IsisMainFieldIterator implements Iterator
{
+ private $class;
+ private $field;
private $valueset;
private $row = 0;
private $rows = 0;
@@ -25,6 +27,8 @@ class IsisMainFieldIterator implements Iterator
public function __construct($class, $field) {
$this->rows = $class->getRows($field);
$this->valueset = $class->getValues($field);
+ $this->class = $class;
+ $this->field = $field;
}
/**
@@ -46,7 +50,8 @@ class IsisMainFieldIterator implements Iterator
* Return the current element.
*/
function current() {
- return $this->valueset[$this->row]['field'];
+ $field = $this->class->getMainFieldName($this->field);
+ return $this->valueset[$this->row][$field];
}
/**