function InOperator::get_value_options

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::get_value_options()
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::value_form in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/InOperator.php
Options form subform for setting options.
11 methods override InOperator::get_value_options()
FieldList::get_value_options 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::get_value_options 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::get_value_options 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::get_value_options 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.
Permissions::get_value_options in drupal/core/modules/user/lib/Drupal/user/Plugin/views/filter/Permissions.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 57
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

function get_value_options() {
  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;
}