You are here

protected function EntityReference::defineOptions in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/views/src/Plugin/views/display/EntityReference.php \Drupal\views\Plugin\views\display\EntityReference::defineOptions()
  2. 8 core/modules/views/src/Plugin/views/style/EntityReference.php \Drupal\views\Plugin\views\style\EntityReference::defineOptions()
  3. 8 core/modules/views/src/Plugin/views/row/EntityReference.php \Drupal\views\Plugin\views\row\EntityReference::defineOptions()
Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/display/EntityReference.php \Drupal\views\Plugin\views\display\EntityReference::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides DisplayPluginBase::defineOptions

File

core/modules/views/src/Plugin/views/display/EntityReference.php, line 50
Contains \Drupal\views\Plugin\views\display\EntityReference.

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'] = 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;
}