You are here

public function OpignoGroupMembershipStatus::getValueOptions in Opigno Learning path 8

Same name and namespace in other branches
  1. 3.x src/Plugin/views/filter/OpignoGroupMembershipStatus.php \Drupal\opigno_learning_path\Plugin\views\filter\OpignoGroupMembershipStatus::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

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

Overrides InOperator::getValueOptions

File

src/Plugin/views/filter/OpignoGroupMembershipStatus.php, line 32

Class

OpignoGroupMembershipStatus
Filters by given list of group membership status options.

Namespace

Drupal\opigno_learning_path\Plugin\views\filter

Code

public function getValueOptions() {
  if (isset($this->valueOptions)) {
    return $this->valueOptions;
  }

  // Array keys are used to compare with the table field values.
  return $this->valueOptions = [
    1 => $this
      ->t('Active'),
    2 => $this
      ->t('Pending'),
    3 => $this
      ->t('Blocked'),
  ];
}