You are here

private function CourseHandler::optionsMerge in Course 6

Same name and namespace in other branches
  1. 7.2 includes/CourseHandler.inc \CourseHandler::optionsMerge()
  2. 7 includes/CourseHandler.inc \CourseHandler::optionsMerge()

Merge arrays with replace, not append.

See also

http://www.php.net/manual/en/function.array-merge-recursive.php#102379

1 call to CourseHandler::optionsMerge()
CourseHandler::addOptions in includes/course.core.inc
Merge an array of options onto the existing options.

File

includes/course.core.inc, line 143
course.core.inc File for main Course class.

Class

CourseHandler
@file course.core.inc File for main Course class.

Code

private function optionsMerge($Arr1, $Arr2) {
  foreach ($Arr2 as $key => $Value) {
    if (array_key_exists($key, $Arr1) && is_array($Value)) {
      $Arr1[$key] = $this
        ->optionsMerge($Arr1[$key], $Arr2[$key]);
    }
    else {
      $Arr1[$key] = $Value;
    }
  }
  return $Arr1;
}