bundle/EventListener/SetCurrentBackendListener.php
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $attributes = $event->getRequest()->attributes;
        if ($attributes->get(SetIsApiRequestListener::API_FLAG_NAME) !== true) {
            return;
        }

        if (!$attributes->has('itemType')) {
            return;
        }

        $backend = $this->backendRegistry->getBackend($attributes->get('itemType'));
        $this->container->set('netgen_content_browser.current_backend', $backend);
    }
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $attributes = $event->getRequest()->attributes;
        if ($attributes->get(SetIsApiRequestListener::API_FLAG_NAME) !== true) {
            return;
        }

        if (!$attributes->has('itemType')) {
            return;
        }

        $backend = $this->backendRegistry->getBackend($attributes->get('itemType'));
        $this->container->set('netgen_content_browser.current_backend', $backend);
    }
public function onKernelRequest ( GetResponseEvent $ event ) : void { if ( ! $ event -> isMasterRequest ( ) ) { return ; } $ attributes = $ event -> getRequest ( ) -> attributes ; if ( $ attributes -> get ( SetIsApiRequestListener :: API_FLAG_NAME ) !== true ) { return ; } if ( ! $ attributes -> has ( 'itemType' ) ) { return ; } $ backend = $ this -> backendRegistry -> getBackend ( $ attributes -> get ( 'itemType' ) ) ; $ this -> container -> set ( 'netgen_content_browser.current_backend' , $ backend ) ; }
Injects the current backend into container.
Injects the current backend into container .