You are here

function views_handler_filter_course::query in Course 7

Same name and namespace in other branches
  1. 8.3 views/handlers/views_handler_filter_course.inc \views_handler_filter_course::query()
  2. 8.2 views/handlers/views_handler_filter_course.inc \views_handler_filter_course::query()
  3. 6 views/handlers/views_handler_filter_course.inc \views_handler_filter_course::query()
  4. 7.2 views/handlers/views_handler_filter_course.inc \views_handler_filter_course::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 views_handler_filter_boolean_operator::query

File

views/handlers/views_handler_filter_course.inc, line 8

Class

views_handler_filter_course
A filter that allows the user to show or hide all courses.

Code

function query() {
  $this
    ->ensure_my_table();
  $field = "{$this->table_alias}.{$this->real_field}";
  $types = course_get_types();
  $in = $this->value ? 'IN' : 'NOT IN';
  $this->query
    ->add_where($this->options['group'], db_and()
    ->condition($field, $types, $in));
}