class WorkspaceRequestSubscriber implements EventSubscriberInterface (View source)

Provides a event subscriber for setting workspace-specific cache keys.

Properties

protected AliasManagerInterface $aliasManager

The alias manager that caches alias lookups based on the request.

protected CurrentPathStack $currentPath

The current path.

protected RouteProviderInterface $routeProvider

The route provider to load routes by name.

protected WorkspaceManagerInterface $workspaceManager

The workspace manager.

Methods

__construct(AliasManagerInterface $alias_manager, CurrentPathStack $current_path, RouteProviderInterface $route_provider, WorkspaceManagerInterface $workspace_manager)

Constructs a new WorkspaceRequestSubscriber instance.

onKernelController(ControllerEvent $event)

Sets the cache key on the alias manager cache decorator.

onKernelRequest(RequestEvent $event)

Adds the active workspace as a cache key part to the route provider.

static 
getSubscribedEvents()

{@inheritDoc}

Details

__construct(AliasManagerInterface $alias_manager, CurrentPathStack $current_path, RouteProviderInterface $route_provider, WorkspaceManagerInterface $workspace_manager)

Constructs a new WorkspaceRequestSubscriber instance.

Parameters

AliasManagerInterface $alias_manager

The alias manager.

CurrentPathStack $current_path

The current path.

RouteProviderInterface $route_provider

The route provider.

WorkspaceManagerInterface $workspace_manager

The workspace manager.

onKernelController(ControllerEvent $event)

Sets the cache key on the alias manager cache decorator.

KernelEvents::CONTROLLER is used in order to be executed after routing.

Parameters

ControllerEvent $event

The Event to process.

onKernelRequest(RequestEvent $event)

Adds the active workspace as a cache key part to the route provider.

Parameters

RequestEvent $event

An event object.

static getSubscribedEvents()

{@inheritDoc}