class AccessAwareRouter implements AccessAwareRouterInterface (View source)

A router class for Drupal with access check and upcasting.

Properties

protected RequestMatcherInterface $router

The router doing the actual routing.

protected AccessManagerInterface $accessManager

The access manager.

protected AccountInterface $account

The account to use in access checks.

Methods

__construct(RequestMatcherInterface $router, AccessManagerInterface $access_manager, AccountInterface $account)

Constructs a router for Drupal with access check and upcasting.

__call($name, $arguments)

{@inheritdoc}

setContext(RequestContext $context)

{@inheritdoc}

getContext()

{@inheritdoc}

array
matchRequest(Request $request)

{@inheritdoc}

checkAccess(Request $request)

Apply access check service to the route and parameters in the request.

RouteCollection
getRouteCollection()

{@inheritdoc}

string
generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH)

{@inheritdoc}

array
match($pathinfo)

{@inheritdoc}

Details

__construct(RequestMatcherInterface $router, AccessManagerInterface $access_manager, AccountInterface $account)

Constructs a router for Drupal with access check and upcasting.

Parameters

RequestMatcherInterface $router

The router doing the actual routing.

AccessManagerInterface $access_manager

The access manager.

AccountInterface $account

The account to use in access checks.

__call($name, $arguments)

{@inheritdoc}

Parameters

$name
$arguments

setContext(RequestContext $context)

{@inheritdoc}

Parameters

RequestContext $context

getContext()

{@inheritdoc}

array matchRequest(Request $request)

{@inheritdoc}

Parameters

Request $request

Return Value

array

Exceptions

AccessDeniedHttpException

protected checkAccess(Request $request)

Apply access check service to the route and parameters in the request.

Parameters

Request $request

The request to access check.

RouteCollection getRouteCollection()

{@inheritdoc}

Return Value

RouteCollection

string generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH)

{@inheritdoc}

Parameters

$name
$parameters
$referenceType

Return Value

string

array match($pathinfo)

{@inheritdoc}

Parameters

$pathinfo

Return Value

array

Exceptions

AccessDeniedHttpException