CoolCMS API

ArticleListRouteFactory extends BaseRouteFactory
in package

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

Properties

$routeManager  : RouteManager
$categoryNameTranslator  : CategoryNameTranslator
$pageSlugTranslator  : PageSlugTranslator
$regionNameTranslator  : RegionNameTranslator

Methods

__construct()  : mixed
create()  : RestrictedTranslatableRoute
Creates the `TranslatableRoute` instance.
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

create()

Creates the `TranslatableRoute` instance.

public create(string $mask, string $module, string $presenter, string $action[, int|null $routeId = null ][, RouteDefinition|null $routeEntity = null ]) : RestrictedTranslatableRoute
Parameters
$mask : string

URL mask (e.g. '/[]')

$module : string

module name (System, Blog, ...)

$presenter : string

presenter name (Page, Article, ...)

$action : string

action name (show, detail, ...)

$routeId : int|null = null

route id from the database

$routeEntity : RouteDefinition|null = null

already loaded definition with its pages

Return values
RestrictedTranslatableRoute

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