src/CoreBundle/Entity/SessionStudentDifficulty.php line 12

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use FOS\UserBundle\Model\User;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Table("session_student_difficulty")
  7. * @ORM\Entity()
  8. */
  9. class SessionStudentDifficulty
  10. {
  11. const DEFAULT_DIFFICULTY = 3;
  12. const TYPE_TRAINING = 1;
  13. CONST TYPE_HOMEWORK = 2;
  14. /**
  15. * @var int
  16. *
  17. * @ORM\Column(name="id", type="integer")
  18. * @ORM\Id
  19. * @ORM\GeneratedValue(strategy="AUTO")
  20. */
  21. private $id;
  22. /**
  23. * @var User
  24. *
  25. * @ORM\ManyToOne(targetEntity="UserBundle\Entity\User",fetch="EAGER")
  26. * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  27. */
  28. private $student;
  29. /**
  30. * 1 - training
  31. * 2 - homework
  32. *
  33. * @ORM\Column(name="type", type="integer")
  34. */
  35. private $type;
  36. /**
  37. * @var Session
  38. *
  39. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\Session")
  40. * @ORM\JoinColumn(name="session_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
  41. */
  42. private $session;
  43. /**
  44. * @var Homework
  45. *
  46. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\Homework")
  47. * @ORM\JoinColumn(name="homework_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
  48. */
  49. private $homework;
  50. /**
  51. * @ORM\Column(name="difficulty", type="integer")
  52. */
  53. private $difficulty = self::DEFAULT_DIFFICULTY;
  54. /**
  55. * @ORM\Column(name="consecutive_correct_answers", type="integer")
  56. */
  57. private $consecutiveCorrectAnswers = 0;
  58. /**
  59. * @ORM\Column(name="repetition_flag", type="smallint", nullable=true, options={"default"=0})
  60. */
  61. private $repetitionFlag = 0;
  62. /**
  63. * Get id.
  64. *
  65. * @return int
  66. */
  67. public function getId()
  68. {
  69. return $this->id;
  70. }
  71. /**
  72. * @return User
  73. */
  74. public function getStudent(): User
  75. {
  76. return $this->student;
  77. }
  78. /**
  79. * @param User $student
  80. */
  81. public function setStudent(User $student): void
  82. {
  83. $this->student = $student;
  84. }
  85. /**
  86. * @return mixed
  87. */
  88. public function getType()
  89. {
  90. return $this->type;
  91. }
  92. /**
  93. * @param mixed $type
  94. */
  95. public function setType($type): void
  96. {
  97. $this->type = $type;
  98. }
  99. /**
  100. * @return Session
  101. */
  102. public function getSession(): Session
  103. {
  104. return $this->session;
  105. }
  106. /**
  107. * @param Session $session
  108. */
  109. public function setSession(Session $session): void
  110. {
  111. $this->session = $session;
  112. }
  113. /**
  114. * @return Homework
  115. */
  116. public function getHomework(): Homework
  117. {
  118. return $this->homework;
  119. }
  120. /**
  121. * @param Homework $homework
  122. */
  123. public function setHomework(Homework $homework): void
  124. {
  125. $this->homework = $homework;
  126. }
  127. /**
  128. * @return int
  129. */
  130. public function getDifficulty(): int
  131. {
  132. return $this->difficulty;
  133. }
  134. /**
  135. * @param int $difficulty
  136. */
  137. public function setDifficulty(int $difficulty): void
  138. {
  139. $this->difficulty = $difficulty;
  140. }
  141. /**
  142. * @return int
  143. */
  144. public function getConsecutiveCorrectAnswers(): int
  145. {
  146. return $this->consecutiveCorrectAnswers;
  147. }
  148. /**
  149. * @param int $consecutiveCorrectAnswers
  150. */
  151. public function setConsecutiveCorrectAnswers(int $consecutiveCorrectAnswers): void
  152. {
  153. $this->consecutiveCorrectAnswers = $consecutiveCorrectAnswers;
  154. }
  155. /**
  156. * @return int
  157. */
  158. public function getRepetitionFlag(): int
  159. {
  160. return $this->repetitionFlag;
  161. }
  162. /**
  163. * @param int $repetitionFlag
  164. */
  165. public function setRepetitionFlag(int $repetitionFlag): void
  166. {
  167. $this->repetitionFlag = $repetitionFlag;
  168. }
  169. }