Guest User

QuestionType

a guest
Dec 11th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Question Model
  2. public function setQuestionTypeAttribute(QuestionType $questionType = null) {
  3.     if ($questionType == null) {
  4.         $this->questionType()->dissociate();
  5.     } else {
  6.         $this->questionType()->associate($questionType);
  7.     }
  8. }
  9.  
  10. // Syntax:
  11. $question->questionType = $questionType;
  12. $question->questionType = null;
Add Comment
Please, Sign In to add comment