Commit 30de0704 authored by David Maus's avatar David Maus
Browse files

Do not delegate getFields() to contained records

* NestedRecord.php (getFields): Do not delegate getFields() to
contained records when called with selector.

Record::select() calls getFields() w/o arguments which returns all
fields.
parent ef202956
......@@ -109,8 +109,6 @@ abstract class NestedRecord extends Record {
/**
* Return fields of the record.
*
* The getFields() is propagated down to all contained records.
*
* @see \HAB\Pica\Record\Record::getFields()
*
* @param string $selector Body of regular expression
......@@ -120,7 +118,7 @@ abstract class NestedRecord extends Record {
if ($selector === null) {
return array_merge($this->_fields, Helper::flatten(Helper::mapMethod($this->_records, 'getFields')));
} else {
return array_merge($this->select(Field::match($selector)), Helper::flatten(Helper::mapMethod($this->_records, 'getFields', array($selector))));
return $this->select(Field::match($selector));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment