diff options
author | Silvio <silvio@devlet.com.br> | 2010-07-19 16:44:48 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2010-07-19 16:44:48 -0300 |
commit | ec7c2ae0788a6423909f93d9fb0c51da29585aa6 (patch) | |
tree | 7da4d368313133d423c2547bc9a1c0a041510446 /classes/iterators | |
parent | 5f0e3d2f891e433f2f0aec1222df6c71eb7cdb62 (diff) | |
download | cinisis-ec7c2ae0788a6423909f93d9fb0c51da29585aa6.tar.gz cinisis-ec7c2ae0788a6423909f93d9fb0c51da29585aa6.tar.bz2 |
More changes to support join_subfields config option
Diffstat (limited to 'classes/iterators')
-rw-r--r-- | classes/iterators/IsisFieldIterator.php | 3 | ||||
-rw-r--r-- | classes/iterators/IsisMainFieldIterator.php | 7 |
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]; } /** |