function NodeRevision::buildDisplayOptions

Same name in other branches
  1. 8.9.x core/modules/node/src/Plugin/views/wizard/NodeRevision.php \Drupal\node\Plugin\views\wizard\NodeRevision::buildDisplayOptions()
  2. 10 core/modules/node/src/Plugin/views/wizard/NodeRevision.php \Drupal\node\Plugin\views\wizard\NodeRevision::buildDisplayOptions()
  3. 11.x core/modules/node/src/Plugin/views/wizard/NodeRevision.php \Drupal\node\Plugin\views\wizard\NodeRevision::buildDisplayOptions()

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

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