function NodeRevision::buildDisplayOptions

Same name and namespace in other branches
  1. 11.x core/modules/node/src/Plugin/views/wizard/NodeRevision.php \Drupal\node\Plugin\views\wizard\NodeRevision::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;
}

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