public function setParam($key, $value)
    {
        if (!array_key_exists($key, $this->getParams())) {
            throw new \Exception("Invalid param '$key' given.");
        }

        $this->params[$key] = $value;
    }