protected function EntityReference::defineOptions

Same name in this branch
  1. 8.x drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/row/EntityReference.php \Drupal\entity_reference\Plugin\views\row\EntityReference::defineOptions()
  2. 8.x drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php \Drupal\entity_reference\Plugin\views\display\EntityReference::defineOptions()
  3. 8.x drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/style/EntityReference.php \Drupal\entity_reference\Plugin\views\style\EntityReference::defineOptions()

Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::defineOptions().

Overrides DisplayPluginBase::defineOptions

File

drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php, line 53
Contains \Drupal\entity_reference\Plugin\views\display\EntityReference.

Class

EntityReference
The plugin that handles an EntityReference display.

Namespace

Drupal\entity_reference\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'] = array(
    'default' => 'entity_reference',
  );
  $options['defaults']['default']['style'] = FALSE;
  $options['row']['contains']['type'] = array(
    'default' => 'entity_reference',
  );
  $options['defaults']['default']['row'] = FALSE;

  // Make sure the query is not cached.
  $options['defaults']['default']['cache'] = 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;
}