Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityReference.php

function EntityReference::defineOptions

Same name in this branch
  1. 11.1.x core/modules/views/src/Plugin/views/filter/EntityReference.php \Drupal\views\Plugin\views\filter\EntityReference::defineOptions()
  2. 11.1.x core/modules/views/src/Plugin/views/row/EntityReference.php \Drupal\views\Plugin\views\row\EntityReference::defineOptions()
  3. 11.1.x core/modules/views/src/Plugin/views/style/EntityReference.php \Drupal\views\Plugin\views\style\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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal