function Serializer::postSaveView

File

core/modules/rest/src/Plugin/views/style/Serializer.php, line 152

Class

Serializer
The style plugin for serialized output formats.

Namespace

Drupal\rest\Plugin\views\style

Code

public function postSaveView(PostSaveProcess $postSaveProcess, ?DisplayPluginInterface $original_display = NULL) : void {
  if ($postSaveProcess->needsRouterRebuild()) {
    return;
  }
  // We need a router rebuild if the available formats have changed because
  // the formats are stored on the route.
  $original_style = $original_display?->getOption('style') ?? [];
  $original_formats = $original_style['options']['formats'] ?? [];
  if ($original_formats != $this->getFormats()) {
    $postSaveProcess->setRouterRebuild();
  }
}

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