You are here

public function UserConsentState::getValueOptions in Data Policy 8

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

array|null The stored values from $this->valueOptions.

Overrides InOperator::getValueOptions

File

src/Plugin/views/filter/UserConsentState.php, line 20

Class

UserConsentState
Simple filter to handle matching of multiple user consent states.

Namespace

Drupal\data_policy\Plugin\views\filter

Code

public function getValueOptions() {
  if (isset($this->valueOptions)) {
    return $this->valueOptions;
  }
  $this->valueOptions = [
    UserConsentInterface::STATE_AGREE => $this
      ->t('Agree'),
    UserConsentInterface::STATE_NOT_AGREE => $this
      ->t('Not agree'),
    UserConsentInterface::STATE_UNDECIDED => $this
      ->t('Undecided'),
  ];
  return $this->valueOptions;
}