You are here

public function OpignoGroupMembershipStatus::query 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::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides InOperator::query

File

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

Class

OpignoGroupMembershipStatus
Filters by given list of group membership status options.

Namespace

Drupal\opigno_learning_path\Plugin\views\filter

Code

public function query() {
  parent::query();
  $join = Views::pluginManager('join')
    ->createInstance('standard', [
    'table' => 'opigno_learning_path_group_user_status',
    'field' => 'mid',
    'left_table' => 'group_content_field_data',
    'left_field' => 'id',
    'operator' => '=',
  ]);
  $this->query
    ->addRelationship('opigno_learning_path_group_user_status', $join, 'group_content');
}