fix var name and add some doc

This commit is contained in:
Jacson Passold 2018-04-13 15:19:57 -03:00
parent 7661718f0c
commit aaaf30306e
1 changed files with 8 additions and 2 deletions

View File

@ -98,6 +98,12 @@ class Exposers {
return $item_arr;
}
/**
* Return array of mapped field
* @param array $item_arr
* @param Mappers\Mapper $mapper
* @return array
*/
protected function map_field($item_arr, $mapper) {
$ret = $item_arr;
$field_mapping = $item_arr['field']['exposer_mapping'];
@ -122,8 +128,8 @@ class Exposers {
$ret = $this->map_field($item_arr, $mapper);
} else { // array of elements
$ret = [];
foreach ($item_arr as $item_field) {
$ret = array_merge($ret, $this->map_field($item_field, $mapper) );
foreach ($item_arr as $item) {
$ret = array_merge($ret, $this->map($item, $mapper, $resquest) );
}
}
return $ret;