public static function paramsReplaceRecursive(array $array1, $array2, $mutableField = false)
    {
        if (!is_array($array2)) {
            return $array1;
        }

        foreach ($array1 as $key => $value) {
            $mutableFields = (is_array($value) && array_key_exists("_mutablefields", $value)) ? (array) $value["_mutablefields"] : $mutableField;

            if (array_key_exists($key, $array2)) {
                if (is_array($value)) {
                    if (is_int(key($value)) || is_null(key($value))) {
                        $array1[$key] = $array2[$key];
                    } else {
                        $array1[$key] = self::paramsReplaceRecursive($array1[$key], $array2[$key], $mutableFields);
                    }
                } else {
                    if (!$mutableField) {
                        $array1[$key] = $array2[$key];
                    } else {
                        if (in_array($key, $mutableFields)) {
                            $array1[$key] = $array2[$key];
                        }
                    }
                }
            }
        }

        return $array1;
    }