CoolCMS API

BaseRouteFactory
in package
implements RouteFactoryInterface

AbstractYes

Base class of all route factories with the shared page whitelist logic.

applyWhitelist() takes the prebuilt RouteDefinition rather than an id, so no extra lookup is needed while the router is built.

Table of Contents

Interfaces

RouteFactoryInterface
Contract of the route factories.

Properties

$routeManager  : RouteManager

Methods

__construct()  : mixed
applyWhitelist()  : void
Restricts a route parameter to the page ids whitelisted in the route definition.
getPageIdsFromEntity()  : array<string|int, int>
Returns the allowed page ids from the route definition (precomputed, no database query).

Properties

Methods

applyWhitelist()

Restricts a route parameter to the page ids whitelisted in the route definition.

protected applyWhitelist(RestrictedTranslatableRoute $route[, RouteDefinition|null $routeEntity = null ][, string $paramName = 'slug' ]) : void
Parameters
$route : RestrictedTranslatableRoute

route to restrict

$routeEntity : RouteDefinition|null = null

definition with precomputed allowed pages; null applies no restriction

$paramName : string = 'slug'

parameter to restrict (default 'slug')

getPageIdsFromEntity()

Returns the allowed page ids from the route definition (precomputed, no database query).

protected getPageIdsFromEntity(RouteDefinition $routeEntity) : array<string|int, int>
Parameters
$routeEntity : RouteDefinition
Return values
array<string|int, int>
On this page

Search results