src/Sulu/Component/Rest/RequestParametersTrait.php
protected function getRequestParameter(Request $request, $name, $force = false, $default = null)
    {
        $value = $request->get($name, $default);
        if ($force && null === $value) {
            throw new MissingParameterException(get_class($this), $name);
        }

        return $value;
    }
protected function getRequestParameter(Request $request, $name, $force = false, $default = null)
    {
        $value = $request->get($name, $default);
        if ($force && null === $value) {
            throw new MissingParameterException(get_class($this), $name);
        }

        return $value;
    }
protected function getRequestParameter ( Request $ request , $ name , $ force = false , $ default = null ) { $ value = $ request -> get ( $ name , $ default ) ; if ( $ force && null === $ value ) { throw new MissingParameterException ( get_class ( $ this ) , $ name ) ; } return $ value ; }
returns request parameter with given name.

@param Request $request
@param string $name
@param bool $force TRUE if value is mandatory
@param mixed $default value if parameter not exists

@throws MissingParameterException parameter is mandatory but does not exists

@return string
returns request parameter with given name .