You are here

public function OpignoTincanQuestionTypeQuestion::getNodeProperties in Opigno TinCan Question Type 7

Getter function returning properties to be loaded when the node is loaded.

Return value

array The node properties

See also

quiz_question_load()

3 calls to OpignoTincanQuestionTypeQuestion::getNodeProperties()
OpignoTincanQuestionTypeQuestion::delete in includes/opigno_tincan_question_type.question.inc
Implementation of delete().
OpignoTincanQuestionTypeQuestion::getAnsweringForm in includes/opigno_tincan_question_type.question.inc
Get the form through which the user will answer the question.
OpignoTincanQuestionTypeQuestion::getCreationForm in includes/opigno_tincan_question_type.question.inc
Get the form used to create a new question.

File

includes/opigno_tincan_question_type.question.inc, line 107
This file contains the class OpignoTincanQuestionTypeQuestion.

Class

OpignoTincanQuestionTypeQuestion
This class goal is to provide specific TinCan question information.

Code

public function getNodeProperties() {
  if (isset($this->nodeProperties['fid'])) {
    return $this->nodeProperties;
  }
  parent::getNodeProperties();
  $result = db_select(OpignoTincanQuestionTypePropertiesDatabase::NAME, 't')
    ->condition('nid', $this->node->nid)
    ->condition('vid', $this->node->vid)
    ->fields('t')
    ->range(0, 1)
    ->execute()
    ->fetchAssoc();
  if ($result) {
    $this->nodeProperties += $result;
  }
  return $this->nodeProperties;
}