public function InOperator::getValueOptions

Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.

This can use a guard to be used to reduce database hits as much as possible.

Return value

Return the stored values in $this->value_options if someone expects it.

3 calls to InOperator::getValueOptions()
InOperator::adminSummary in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
Display the filter on the administrative summary
InOperator::validate in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
Validates the handler against the complete View.
InOperator::valueForm in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
Options form subform for setting options.
9 methods override InOperator::getValueOptions()
Bundle::getValueOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/Bundle.php
Overrides \Drupal\views\Plugin\views\filter\InOperator::getValueOptions().
FieldList::getValueOptions in drupal/core/modules/field/lib/Drupal/field/Plugin/views/filter/FieldList.php
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
LanguageFilter::getValueOptions in drupal/core/modules/language/lib/Drupal/language/Plugin/views/filter/LanguageFilter.php
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
Name::getValueOptions in drupal/core/modules/user/lib/Drupal/user/Plugin/views/filter/Name.php
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
NodeComment::getValueOptions in drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/filter/NodeComment.php
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.

... See full list

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php, line 56
Definition of Drupal\views\Plugin\views\filter\InOperator.

Class

InOperator
Simple filter to handle matching of multiple options selectable via checkboxes

Namespace

Drupal\views\Plugin\views\filter

Code

public function getValueOptions() {
  if (isset($this->value_options)) {
    return;
  }
  if (isset($this->definition['options callback']) && is_callable($this->definition['options callback'])) {
    if (isset($this->definition['options arguments']) && is_array($this->definition['options arguments'])) {
      $this->value_options = call_user_func_array($this->definition['options callback'], $this->definition['options arguments']);
    }
    else {
      $this->value_options = call_user_func($this->definition['options callback']);
    }
  }
  else {
    $this->value_options = array(
      t('Yes'),
      t('No'),
    );
  }
  return $this->value_options;
}