function _answers_question_answers in Answers 7.3
Same name and namespace in other branches
- 6.2 answers.module \_answers_question_answers()
- 6 answers.module \_answers_question_answers()
- 7 answers.module \_answers_question_answers()
- 7.2 answers.module \_answers_question_answers()
Gathers a list of answer NIDS for a given question.
Parameters
object $question: Either a numeric node NID or a node object.
Return value
array Returns an array of answer node NIDs.
1 call to _answers_question_answers()
- answers_node_delete in ./
answers.module - Implements hook_node_delete().
File
- ./
answers.module, line 216
Code
function _answers_question_answers($question) {
$results = array();
$qid = is_object($question) ? $question->nid : $question;
$view = views_get_view('answers_to_a_question');
$view
->set_arguments(array(
$qid,
));
$view
->execute();
foreach ($view->result as $result) {
$nid = $result->nid;
$results[$nid] = $nid;
}
return $results;
}