Modules\Core\Source\Libs\Middleware\OrderTypeMiddleware::__invoke PHP Method

__invoke() public method

public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, $next )
$request Psr\Http\Message\ServerRequestInterface
$response Psr\Http\Message\ResponseInterface
    public function __invoke(Request $request, Response $response, $next)
    {
        $this->req = $request;
        $this->res = $response;
        $allParams = new RequestParams($this->req);
        if (Session::has('auth') && Session::get('auth') && ($allParams->all($this->variableName[0]) || $allParams->all($this->variableName[1]))) {
            $this->groupName = $this->groupName . basename($allParams->getRequest()->getUri()->getPath());
            $varName = $this->variableName[0];
            if ($allParams->all($varName)) {
                $this->setOption($varName, $allParams);
            }
            $varName = $this->variableName[1];
            if ($allParams->all($varName)) {
                $this->setOption($varName, $allParams);
            }
        }
        return $next($request, $response);
    }