protected function initRequest(Lang $lang = null)
    {
        $container = $this->getContainer();

        $request = Request::create($this->getBaseUrl($lang));
        $request->setSession(new Session(new MockArraySessionStorage()));
        $container->set("request_stack", new RequestStack());
        $container->get('request_stack')->push($request);

        $requestContext = new RequestContext();
        $requestContext->fromRequest($request);
        $url = $container->get('thelia.url.manager');
        $url->setRequestContext($requestContext);
        $this->getContainer()->get('router.admin')->setContext($requestContext);
    }
protected function initRequest(Lang $lang = null)
    {
        $container = $this->getContainer();

        $request = Request::create($this->getBaseUrl($lang));
        $request->setSession(new Session(new MockArraySessionStorage()));
        $container->set("request_stack", new RequestStack());
        $container->get('request_stack')->push($request);

        $requestContext = new RequestContext();
        $requestContext->fromRequest($request);
        $url = $container->get('thelia.url.manager');
        $url->setRequestContext($requestContext);
        $this->getContainer()->get('router.admin')->setContext($requestContext);
    }
protected function initRequest ( Lang $ lang = null ) { $ container = $ this -> getContainer ( ) ; $ request = Request :: create ( $ this -> getBaseUrl ( $ lang ) ) ; $ request -> setSession ( new Session ( new MockArraySessionStorage ( ) ) ) ; $ container -> set ( "request_stack" , new RequestStack ( ) ) ; $ container -> get ( 'request_stack' ) -> push ( $ request ) ; $ requestContext = new RequestContext ( ) ; $ requestContext -> fromRequest ( $ request ) ; $ url = $ container -> get ( 'thelia.url.manager' ) ; $ url -> setRequestContext ( $ requestContext ) ; $ this -> getContainer ( ) -> get ( 'router.admin' ) -> setContext ( $ requestContext ) ; }
For init an Request, if your command has need an Request
@param Lang|null $lang
@since 2.3
For init an Request if your command has need an Request