You are here

public function ReadOnlyModeMethodFilter::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/Routing/ReadOnlyModeMethodFilter.php \Drupal\jsonapi\Routing\ReadOnlyModeMethodFilter::__construct()

ReadOnlyModeMethodFilter constructor.

Parameters

\Drupal\Core\Routing\FilterInterface $inner: The decorated method filter.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration factory.

File

core/modules/jsonapi/src/Routing/ReadOnlyModeMethodFilter.php, line 39

Class

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

Namespace

Drupal\jsonapi\Routing

Code

public function __construct(FilterInterface $inner, ConfigFactoryInterface $config_factory) {
  $this->inner = $inner;
  $this->readOnlyModeIsEnabled = $config_factory
    ->get('jsonapi.settings')
    ->get('read_only');
}