function RestConfigSubscriber::onSave

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

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