From ec7c2ae0788a6423909f93d9fb0c51da29585aa6 Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 19 Jul 2010 16:44:48 -0300 Subject: More changes to support join_subfields config option --- classes/iterators/IsisFieldIterator.php | 3 --- classes/iterators/IsisMainFieldIterator.php | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'classes/iterators') 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]; } /** -- cgit v1.2.3