You are here

protected function RestExport::defineOptions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/rest/src/Plugin/views/display/RestExport.php \Drupal\rest\Plugin\views\display\RestExport::defineOptions()
  2. 10 core/modules/rest/src/Plugin/views/display/RestExport.php \Drupal\rest\Plugin\views\display\RestExport::defineOptions()

Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase:defineOptions().

Overrides PathPluginBase::defineOptions

File

core/modules/rest/src/Plugin/views/display/RestExport.php, line 253

Class

RestExport
The plugin that handles Data response callbacks for REST resources.

Namespace

Drupal\rest\Plugin\views\display

Code

protected function defineOptions() {
  $options = parent::defineOptions();

  // Options for REST authentication.
  $options['auth'] = [
    'default' => [],
  ];

  // Set the default style plugin to 'json'.
  $options['style']['contains']['type']['default'] = 'serializer';
  $options['row']['contains']['type']['default'] = 'data_entity';
  $options['defaults']['default']['style'] = FALSE;
  $options['defaults']['default']['row'] = FALSE;

  // Remove css/exposed form settings, as they are not used for the data display.
  unset($options['exposed_form']);
  unset($options['exposed_block']);
  unset($options['css_class']);
  return $options;
}