class RouteBuilder implements RouteBuilderInterface, DestructableInterface (View source)

Managing class for rebuilding the router table.

Properties

protected MatcherDumperInterface $dumper

The dumper to which we should send collected routes.

protected LockBackendInterface $lock

The used lock backend instance.

protected EventDispatcherInterface $dispatcher

The event dispatcher to notify of routes.

protected ModuleHandlerInterface $moduleHandler

The module handler.

protected ControllerResolverInterface $controllerResolver

The controller resolver.

protected RouteCollection $routeCollection

The route collection during the rebuild.

protected bool $building

Flag that indicates if we are currently rebuilding the routes.

protected bool $rebuildNeeded

Flag that indicates if we should rebuild at the end of the request.

protected CheckProviderInterface $checkProvider

The check provider.

Methods

__construct(MatcherDumperInterface $dumper, LockBackendInterface $lock, EventDispatcherInterface $dispatcher, ModuleHandlerInterface $module_handler, ControllerResolverInterface $controller_resolver, CheckProviderInterface $check_provider)

Constructs the RouteBuilder using the passed MatcherDumperInterface.

setRebuildNeeded()

Sets the router to be rebuilt next time rebuildIfNeeded() is called.

bool
rebuild()

Rebuilds the route information and dumps it.

bool
rebuildIfNeeded()

Rebuilds the route information if necessary, and dumps it.

destruct()

Performs destruct operations.

array
getRouteDefinitions()

Retrieves all defined routes from .routing.yml files.

Details

__construct(MatcherDumperInterface $dumper, LockBackendInterface $lock, EventDispatcherInterface $dispatcher, ModuleHandlerInterface $module_handler, ControllerResolverInterface $controller_resolver, CheckProviderInterface $check_provider)

Constructs the RouteBuilder using the passed MatcherDumperInterface.

Parameters

MatcherDumperInterface $dumper

The matcher dumper used to store the route information.

LockBackendInterface $lock

The lock backend.

EventDispatcherInterface $dispatcher

The event dispatcher to notify of routes.

ModuleHandlerInterface $module_handler

The module handler.

ControllerResolverInterface $controller_resolver

The controller resolver.

CheckProviderInterface $check_provider

The check provider.

setRebuildNeeded()

Sets the router to be rebuilt next time rebuildIfNeeded() is called.

bool rebuild()

Rebuilds the route information and dumps it.

Return Value

bool

Returns TRUE if the rebuild succeeds, FALSE otherwise.

bool rebuildIfNeeded()

Rebuilds the route information if necessary, and dumps it.

Return Value

bool

Returns TRUE if the rebuild occurs, FALSE otherwise.

destruct()

Performs destruct operations.

protected array getRouteDefinitions()

Retrieves all defined routes from .routing.yml files.

Return Value

array

The defined routes, keyed by provider.