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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.