protected function getGroupsForSave()
{
$groups = $this->getRequest()->getPost('groups');
$files = $this->getRequest()->getFiles('groups');
if ($files && is_array($files)) {
/**
* Carefully merge $_FILES and $_POST information
* None of '+=' or 'array_merge_recursive' can do this correct
*/
foreach ($files as $groupName => $group) {
$data = $this->processNestedGroups($group);
if (!empty($data)) {
if (!empty($groups[$groupName])) {
$groups[$groupName] = array_merge_recursive((array) $groups[$groupName], $data);
} else {
$groups[$groupName] = $data;
}
}
}
}
return $groups;
}