src/Sulu/Component/Rest/RequestParametersTrait.php
protected function getBooleanRequestParameter($request, $name, $force = false, $default = null)
    {
        $value = $this->getRequestParameter($request, $name, $force, $default);
        if ('true' === $value || true === $value) {
            $value = true;
        } elseif ('false' === $value || false === $value) {
            $value = false;
        } elseif ($force && true !== $value && false !== $value) {
            throw new ParameterDataTypeException(get_class($this), $name);
        } else {
            $value = $default;
        }

        return $value;
    }
protected function getBooleanRequestParameter($request, $name, $force = false, $default = null)
    {
        $value = $this->getRequestParameter($request, $name, $force, $default);
        if ('true' === $value || true === $value) {
            $value = true;
        } elseif ('false' === $value || false === $value) {
            $value = false;
        } elseif ($force && true !== $value && false !== $value) {
            throw new ParameterDataTypeException(get_class($this), $name);
        } else {
            $value = $default;
        }

        return $value;
    }
protected function getBooleanRequestParameter ( $ request , $ name , $ force = false , $ default = null ) { $ value = $ this -> getRequestParameter ( $ request , $ name , $ force , $ default ) ; if ( 'true' === $ value || true === $ value ) { $ value = true ; } elseif ( 'false' === $ value || false === $ value ) { $ value = false ; } elseif ( $ force && true !== $ value && false !== $ value ) { throw new ParameterDataTypeException ( get_class ( $ this ) , $ name ) ; } else { $ value = $ default ; } return $ value ; }
returns request parameter as boolean 'true' => true , 'false' => false.

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

@throws MissingParameterException parameter is mandatory but does not exists
@throws ParameterDataTypeException parameter hast the wrong data type

@return bool
returns request parameter as boolean true = > true false = > false .