/** * assigns the field elements of passed hint db row array to the * corresponding hint object properties of passed hint object instance * * @access public * @static * @param self $questionHint * @param array $hintDbRow */ public static function assignDbRow(self $questionHint, $hintDbRow) { foreach ($hintDbRow as $field => $value) { switch ($field) { case 'qht_hint_id': $questionHint->setId($value); break; case 'qht_question_fi': $questionHint->setQuestionId($value); break; case 'qht_hint_index': $questionHint->setIndex($value); break; case 'qht_hint_points': $questionHint->setPoints($value); break; case 'qht_hint_text': $questionHint->setText($value); break; default: throw new ilTestQuestionPoolException("invalid db field identifier ({$field}) given!"); } } }