class ReadOnlyModeMethodFilter implements FilterInterface (View source)

Filters routes based on the HTTP method and JSON:API's read-only mode.

Properties

protected FilterInterface $inner

The decorated method filter.

protected bool $readOnlyModeIsEnabled

Whether JSON:API's read-only mode is enabled.

Methods

__construct(FilterInterface $inner, ConfigFactoryInterface $config_factory)

ReadOnlyModeMethodFilter constructor.

RouteCollection
filter(RouteCollection $collection, Request $request)

Filters the route collection against a request and returns all matching routes.

Details

__construct(FilterInterface $inner, ConfigFactoryInterface $config_factory)

ReadOnlyModeMethodFilter constructor.

Parameters

FilterInterface $inner

The decorated method filter.

ConfigFactoryInterface $config_factory

The configuration factory.

RouteCollection filter(RouteCollection $collection, Request $request)

Filters the route collection against a request and returns all matching routes.

Parameters

RouteCollection $collection

The collection against which to match.

Request $request

A Request object against which to match.

Return Value

RouteCollection

A non-empty RouteCollection of matched routes

Exceptions

ResourceNotFoundException