public function checkParams(array $params, &$error = null)
    {
        $result = array();
        foreach ($this->paramsReq as $param) {
            if (!array_key_exists($param, $params)) {
                $error = 'required '.$param;
                return false;
            }
            $result[$param] = $params[$param];
        }
        foreach ($this->paramsDefault as $param => $default) {
            if (array_key_exists($param, $params)) {
                $result[$param] = $params[$param];
            } else {
                $result[$param] = $default;
            }
        }
        return $result;
    }