Пример #1
0
 /**
  * @param array $item
  * @param string $from
  * @param string $to
  * @return array
  */
 protected function applyMapping(array $item, $from, $to)
 {
     if ($from !== $this->nestKey) {
         return parent::applyMapping($item, $from, $to);
     }
     foreach ($item[$this->nestKey] as $key => $nestedItem) {
         foreach ($to as $nestedFrom => $nestedTo) {
             $nestedItem = parent::applyMapping($nestedItem, $nestedFrom, $nestedTo);
         }
         $item[$this->nestKey][$key] = $nestedItem;
     }
     return $item;
 }