You are here

function quiz_views_handler_filter_quiz_question::query in Quiz 7.6

Same name and namespace in other branches
  1. 7.5 includes/views/handlers/quiz_views_handler_filter_quiz_question.inc \quiz_views_handler_filter_quiz_question::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

includes/views/handlers/quiz_views_handler_filter_quiz_question.inc, line 8

Class

quiz_views_handler_filter_quiz_question
A filter that allows the user to show or hide all quiz questions.

Code

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