You are here

function answers_query_question_unlocked_alter in Answers 7.4

Implements hook_query_TAG_alter().

The 'question_unlocked' tag modifies the query to return only those questions which are not locked.

File

includes/answers.lock.inc, line 163
Question locking functions for the 'Answers' module.

Code

function answers_query_question_unlocked_alter(QueryAlterableInterface $query) {
  $query
    ->leftJoin('field_data_question_locks', 'l', 'node.nid = l.entity_id AND l.entity_type = :entity_type', array(
    ':entity_type' => 'node',
  ));
  $query
    ->isNull('l.question_locks_value');
}