src/CoreBundle/Entity/CrammingActivityUnit.php line 15

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use DateTime;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use UserBundle\Entity\User;
  8. /**
  9. * @ORM\Table("cramming_activity_unit")
  10. * @ORM\Entity(repositoryClass="CoreBundle\Entity\CrammingActivityUnitRepository")
  11. */
  12. class CrammingActivityUnit
  13. {
  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 CrammingActivity
  24. *
  25. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\CrammingActivity", inversedBy="crammingActivityUnits")
  26. * @ORM\JoinColumn(name="cramming_activity", referencedColumnName="id", onDelete="CASCADE")
  27. */
  28. private $crammingActivity;
  29. /**
  30. * @var User
  31. *
  32. * @ORM\ManyToOne(targetEntity="UserBundle\Entity\User")
  33. * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  34. */
  35. private $student;
  36. /**
  37. * @var CrammingActivityResponse[]
  38. *
  39. * @ORM\OneToMany(targetEntity="CrammingActivityResponse",
  40. * mappedBy="crammingActivityUnit", cascade={"persist","remove"})
  41. */
  42. private $CrammingActivityResponses;
  43. /**
  44. * @var \DateTime
  45. *
  46. * @ORM\Column(name="start_time", type="datetime", nullable=true)
  47. */
  48. protected $startTime;
  49. /**
  50. * @var \DateTime
  51. *
  52. * @ORM\Column(name="deadline", type="datetime", nullable=true)
  53. */
  54. protected $deadline;
  55. /**
  56. * @var int
  57. *
  58. * @ORM\Column(name="seconds_left", type="integer", nullable=true, options={"default":0})
  59. */
  60. private $secondsLeft;
  61. /**
  62. * @var int
  63. *
  64. * @ORM\Column(name="seconds_paused", type="integer", nullable=true, options={"default":0})
  65. */
  66. private $secondsPaused;
  67. /**
  68. * @var \DateTime
  69. *
  70. * @ORM\Column(name="time_paused", type="datetime", nullable=true)
  71. */
  72. private $timePaused;
  73. /**
  74. * @var \DateTime
  75. *
  76. * @ORM\Column(name="time_resumed", type="datetime", nullable=true)
  77. */
  78. private $timeResumed;
  79. /**
  80. * @ORM\Column(name="is_paused", type="integer", nullable=true, options={"default"=0})
  81. */
  82. private $isPaused = 0;
  83. /**
  84. * @var string|null
  85. *
  86. * @ORM\Column(name="current_difficulties", type="string", length=4096, nullable=true)
  87. */
  88. private $currentDifficulties;
  89. /**
  90. * @var string
  91. *
  92. * @ORM\Column(name="disabled_template_sets", type="string", length=256, nullable=true)
  93. */
  94. private $disabledTemplateSets;
  95. /**
  96. * @var \DateTime
  97. *
  98. * @ORM\Column(name="extended_deadline", type="datetime", nullable=true)
  99. */
  100. private $extendedDeadline;
  101. /**
  102. * @ORM\OneToMany(targetEntity="CrammingActivityResponse",
  103. * mappedBy="crammingActivityUnit", cascade={"persist","remove"})
  104. */
  105. private Collection $crammingActivityResponses;
  106. public function __construct()
  107. {
  108. $this->crammingActivityResponses = new ArrayCollection();
  109. }
  110. /**
  111. * @return int
  112. */
  113. public function getId(): int
  114. {
  115. return $this->id;
  116. }
  117. /**
  118. * @param int $id
  119. */
  120. public function setId(int $id): void
  121. {
  122. $this->id = $id;
  123. }
  124. /**
  125. * @return CrammingActivity
  126. */
  127. public function getCrammingActivity(): CrammingActivity
  128. {
  129. return $this->crammingActivity;
  130. }
  131. /**
  132. * @param CrammingActivity $crammingActivity
  133. */
  134. public function setCrammingActivity(CrammingActivity $crammingActivity): void
  135. {
  136. $this->crammingActivity = $crammingActivity;
  137. }
  138. /**
  139. * @return User
  140. */
  141. public function getStudent(): User
  142. {
  143. return $this->student;
  144. }
  145. /**
  146. * @param User $student
  147. */
  148. public function setStudent(User $student): void
  149. {
  150. $this->student = $student;
  151. }
  152. /**
  153. * @return ArrayCollection|CrammingActivityResponse[]
  154. */
  155. public function getCrammingActivityResponses(): Collection
  156. {
  157. return $this->crammingActivityResponses;
  158. }
  159. /**
  160. * @param CrammingActivityResponse[]|ArrayCollection $crammingActivityResponses
  161. */
  162. public function setCrammingActivityResponses(array $crammingActivityResponses): void
  163. {
  164. $this->crammingActivityResponses = $crammingActivityResponses;
  165. }
  166. /**
  167. * @return \DateTime
  168. */
  169. public function getStartTime(): ?\DateTime
  170. {
  171. return $this->startTime;
  172. }
  173. /**
  174. * @param \DateTime $startTime
  175. */
  176. public function setStartTime(?\DateTime $startTime): void
  177. {
  178. $this->startTime = $startTime;
  179. }
  180. /**
  181. * @return \DateTime
  182. */
  183. public function getDeadline(): ?\DateTime
  184. {
  185. return $this->deadline;
  186. }
  187. /**
  188. * @param \DateTime $deadline
  189. */
  190. public function setDeadline(?\DateTime $deadline): void
  191. {
  192. $this->deadline = $deadline;
  193. }
  194. /**
  195. * @return int
  196. */
  197. public function getSecondsLeft(): ?int
  198. {
  199. return $this->secondsLeft;
  200. }
  201. /**
  202. * @param int $secondsLeft
  203. */
  204. public function setSecondsLeft(?int $secondsLeft): void
  205. {
  206. $this->secondsLeft = $secondsLeft;
  207. }
  208. /**
  209. * @return int
  210. */
  211. public function getSecondsPaused(): ?int
  212. {
  213. return $this->secondsPaused;
  214. }
  215. /**
  216. * @param int $secondsPaused
  217. */
  218. public function setSecondsPaused(?int $secondsPaused): void
  219. {
  220. $this->secondsPaused = $secondsPaused;
  221. }
  222. /**
  223. * @param int $secondsPaused
  224. */
  225. public function addSecondsPaused(int $secondsPaused)
  226. {
  227. $this->secondsPaused += $secondsPaused;
  228. }
  229. /**
  230. * @return \DateTime
  231. */
  232. public function getTimePaused(): ?\DateTime
  233. {
  234. return $this->timePaused;
  235. }
  236. /**
  237. * @param \DateTime $timePaused
  238. */
  239. public function setTimePaused(?\DateTime $timePaused): void
  240. {
  241. $this->timePaused = $timePaused;
  242. }
  243. /**
  244. * @return \DateTime
  245. */
  246. public function getTimeResumed(): ?\DateTime
  247. {
  248. return $this->timeResumed;
  249. }
  250. /**
  251. * @param \DateTime $timeResumed
  252. */
  253. public function setTimeResumed(?\DateTime $timeResumed): void
  254. {
  255. $this->timeResumed = $timeResumed;
  256. }
  257. /**
  258. * @return int
  259. */
  260. public function getIsPaused(): int
  261. {
  262. return $this->isPaused;
  263. }
  264. /**
  265. * @param int $isPaused
  266. */
  267. public function setIsPaused(int $isPaused): void
  268. {
  269. $this->isPaused = $isPaused;
  270. }
  271. /**
  272. * @return string|null
  273. */
  274. public function getCurrentDifficulties()
  275. {
  276. return $this->currentDifficulties;
  277. }
  278. /**
  279. * @param $currentDifficulties
  280. */
  281. public function setCurrentDifficulties($currentDifficulties): void
  282. {
  283. $this->currentDifficulties = $currentDifficulties;
  284. }
  285. /**
  286. * @return mixed
  287. */
  288. public function getDisabledTemplateSets()
  289. {
  290. return $this->disabledTemplateSets;
  291. }
  292. /**
  293. * @param mixed $disabledTemplateSets
  294. */
  295. public function setDisabledTemplateSets($disabledTemplateSets): void
  296. {
  297. $this->disabledTemplateSets = $disabledTemplateSets;
  298. }
  299. /**
  300. * @return DateTime|null
  301. */
  302. public function getExtendedDeadline(): ?\DateTime
  303. {
  304. return $this->extendedDeadline;
  305. }
  306. /**
  307. * @param DateTime $extendedDeadline
  308. */
  309. public function setExtendedDeadline(DateTime $extendedDeadline): void
  310. {
  311. $this->extendedDeadline = $extendedDeadline;
  312. }
  313. }