You are here

public function ReadOnlyModeMethodFilter::__construct in JSON:API 8.2

ReadOnlyModeMethodFilter constructor.

Parameters

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

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

File

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');
}