You are here

public function EREFNodeTitles::valueForm in Entity Reference Exposed Filters 8

Options form subform for setting options.

This should be overridden by all child classes and it must define $form['value']

Overrides ManyToOne::valueForm

See also

buildOptionsForm()

File

src/Plugin/views/filter/EREFNodeTitles.php, line 253

Class

EREFNodeTitles
Filters by given list of related content title options.

Namespace

Drupal\entity_reference_exposed_filters\Plugin\views\filter

Code

public function valueForm(&$form, FormStateInterface $form_state) {
  parent::valueForm($form, $form_state);

  // Reduce duplicates does not work. Do we need it?
  $form['reduce_duplicates']['#default_value'] = 0;
  $form['reduce_duplicates'] = [
    '#disabled' => TRUE,
  ];

  // Disable the none option. we have to have a relationship.
  unset($form['relationship']['#options']['none']);

  // Disable the expose button. this should be an exposed filter.
  $form['expose_button'] = [
    '#disabled' => TRUE,
  ];
}