You are here

function _answers_question_answers in Answers 6

Same name and namespace in other branches
  1. 6.2 answers.module \_answers_question_answers()
  2. 7 answers.module \_answers_question_answers()
  3. 7.2 answers.module \_answers_question_answers()
  4. 7.3 answers.module \_answers_question_answers()
1 call to _answers_question_answers()
answers_nodeapi in ./answers.module

File

./answers.module, line 106

Code

function _answers_question_answers($question) {
  $results = array();
  $qid = is_object($question) ? $question->nid : $question;

  // Use views as a query engine
  $view = views_get_view('question_answers');
  $view
    ->set_arguments(array(
    $qid,
  ));
  $view
    ->execute();
  foreach ($view->result as $result) {
    $nid = $result->nid;
    $results[$nid] = $nid;
  }
  return $results;
}