function EntityReference::defineOptions

Overrides DisplayPluginBase::defineOptions

File

core/modules/views/src/Plugin/views/display/EntityReference.php, line 91

Class

EntityReference
The plugin that handles an EntityReference display.

Namespace

Drupal\views\Plugin\views\display

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  // Force the style plugin to 'entity_reference_style' and the row plugin to
  // 'fields'.
  $options['style']['contains']['type'] = [
    'default' => 'entity_reference',
  ];
  $options['defaults']['default']['style'] = FALSE;
  $options['row']['contains']['type'] = [
    'default' => 'entity_reference',
  ];
  $options['defaults']['default']['row'] = FALSE;
  // Set the display title to an empty string (not used in this display type).
  $options['title']['default'] = '';
  $options['defaults']['default']['title'] = FALSE;
  return $options;
}

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