public function OpignoGroupMembershipBoolean::getValueOptions in Opigno Learning path 3.x
Same name and namespace in other branches
- 8 src/Plugin/views/filter/OpignoGroupMembershipBoolean.php \Drupal\opigno_learning_path\Plugin\views\filter\OpignoGroupMembershipBoolean::getValueOptions()
Return the possible options for this filter.
Child classes should override this function to set the possible values for the filter. Since this is a boolean filter, the array should have two possible keys: 1 for "True" and 0 for "False", although the labels can be whatever makes sense for the filter. These values are used for configuring the filter, when the filter is exposed, and in the admin summary of the filter. Normally, this should be static data, but if it's dynamic for some reason, child classes should use a guard to reduce database hits as much as possible.
Overrides BooleanOperator::getValueOptions
1 call to OpignoGroupMembershipBoolean::getValueOptions()
- OpignoGroupMembershipBoolean::valueForm in src/
Plugin/ views/ filter/ OpignoGroupMembershipBoolean.php - Options form subform for setting options.
File
- src/
Plugin/ views/ filter/ OpignoGroupMembershipBoolean.php, line 30
Class
- OpignoGroupMembershipBoolean
- Filter handler to show trainings filter.
Namespace
Drupal\opigno_learning_path\Plugin\views\filterCode
public function getValueOptions() {
// Specify available options.
$this->valueOptions = [
0 => $this
->t('All trainings'),
1 => $this
->t('My trainings'),
];
}