Example #1
0
 /**
  * Map the fields in a row of values from|to a sub model
  *
  * @param array $row The row of values to map
  * @param string $name Union sub model name
  * @param boolean $from When true map from the fields names in the sub model to the fields names of this model
  * @param boolean $recursive When true sub arrays are mapped as well (only used for filter renaming)
  * @return array
  */
 protected function _map(array $row, $name, $from = true, $recursive = false)
 {
     if ($from) {
         $mapStore = $this->_unionMapsFrom;
     } else {
         $mapStore = $this->_unionMapsTo;
     }
     if (!(isset($mapStore[$name]) && $mapStore[$name])) {
         return $row;
     }
     return \MUtil_Ra::map($row, $mapStore[$name], $recursive);
 }