You are here

protected function NodeRevision::buildDisplayOptions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/node/src/Plugin/views/wizard/NodeRevision.php \Drupal\node\Plugin\views\wizard\NodeRevision::buildDisplayOptions()
  2. 9 core/modules/node/src/Plugin/views/wizard/NodeRevision.php \Drupal\node\Plugin\views\wizard\NodeRevision::buildDisplayOptions()

Builds an array of display options for the view.

Return value

array An array whose keys are the names of each display and whose values are arrays of options for that display.

Overrides WizardPluginBase::buildDisplayOptions

File

core/modules/node/src/Plugin/views/wizard/NodeRevision.php, line 124

Class

NodeRevision
Tests creating node revision views with the wizard.

Namespace

Drupal\node\Plugin\views\wizard

Code

protected function buildDisplayOptions($form, FormStateInterface $form_state) {
  $display_options = parent::buildDisplayOptions($form, $form_state);
  if (isset($display_options['default']['filters']['type'])) {
    $display_options['default']['relationships']['nid'] = [
      'id' => 'nid',
      'table' => 'node_field_revision',
      'field' => 'nid',
      'relationship' => 'none',
      'group_type' => 'group',
      'admin_label' => 'Get the actual content from a content revision.',
      'required' => 'true',
      'entity_type' => 'node',
      'entity_field' => 'nid',
      'plugin_id' => 'standard',
    ];
  }
  return $display_options;
}