protected function mergeParams(&$data, $params)
    {

        // merge the passed params into the configuration data
        foreach ($params as $paramName => $paramValue) {
            if (is_array($paramValue)) {
                foreach ($paramValue as $key => $value) {
                    foreach ($value as $name => $x) {
                        $data[$paramName][$key][$name] = $x;
                    }
                }
            } else {
                $data[$paramName] = $paramValue;
            }
        }
    }