RouteTableBuilder
in package
Builds the complete {@see RouteTableSnapshot} from the database.
It reads three sets, each with a single findAll():
- localizations into
localeMap(as LocaleResolver::warmupCache()), - routes into route definitions (presenter existence filter, factory class normalization, page ids from the M2M relation),
- pages into the slug maps (as PageSlugTranslator::warmupFromEntities()).
This is the only data path: the builder runs even with the cache disabled and the cache only wraps it, so the two cannot drift apart. The presenter existence check runs only here; running it per request would log a warning for every dead route.
Table of Contents
Properties
Methods
- __construct() : mixed
- build() : RouteTableSnapshot
- Builds the complete snapshot from the database.
-
buildLocaleMap()
: array{0: array
, 1: string} - buildRouteDefinitions() : array<int, RouteDefinition>
-
buildSlugMaps()
: array{0: array
>, 1: array >} - Builds both slug maps explicitly (no flipping), identical to `PageSlugTranslator::warmupFromEntities()` including the skip of translations without `href`. Pages are read separately because the route graph does not cover pages without a route.
- extractPageIds() : array<int, int>
- Returns the whitelisted page ids from the M2M `page_route_rel` relation.
Properties
$localizationManager read-only
private
LocalizationManager
$localizationManager
$pageManager read-only
private
PageManager
$pageManager
$routeManager read-only
private
RouteManager
$routeManager
Methods
__construct()
public
__construct(RouteManager $routeManager, PageManager $pageManager, LocalizationManager $localizationManager) : mixed
Parameters
- $routeManager : RouteManager
- $pageManager : PageManager
- $localizationManager : LocalizationManager
build()
Builds the complete snapshot from the database.
public
build() : RouteTableSnapshot
Return values
RouteTableSnapshotbuildLocaleMap()
private
buildLocaleMap() : array{0: array, 1: string}
Return values
array{0: array[locale] = languageId, and the key of the main localization
(localizations.main; cs when none is marked)
buildRouteDefinitions()
private
buildRouteDefinitions() : array<int, RouteDefinition>
Return values
array<int, RouteDefinition> —in match priority order (as returned by findAll())
buildSlugMaps()
Builds both slug maps explicitly (no flipping), identical to `PageSlugTranslator::warmupFromEntities()` including the skip of translations without `href`. Pages are read separately because the route graph does not cover pages without a route.
private
buildSlugMaps() : array{0: array>, 1: array>}
Return values
array{0: arrayextractPageIds()
Returns the whitelisted page ids from the M2M `page_route_rel` relation.
private
extractPageIds(Route $route) : array<int, int>
Parameters
- $route : Route