You are here

public function RestConfigSubscriber::onSave in Drupal 8

Informs the router builder a rebuild is needed when necessary.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event: The Event to process.

File

core/modules/rest/src/EventSubscriber/RestConfigSubscriber.php, line 38

Class

RestConfigSubscriber
A subscriber triggering a route rebuild when certain configuration changes.

Namespace

Drupal\rest\EventSubscriber

Code

public function onSave(ConfigCrudEvent $event) {
  $saved_config = $event
    ->getConfig();

  // @see \Drupal\rest\Plugin\rest\resource\EntityResource::permissions()
  if ($saved_config
    ->getName() === 'rest.settings' && $event
    ->isChanged('bc_entity_resource_permissions')) {
    $this->routerBuilder
      ->setRebuildNeeded();
  }
}