src/Entity/PaidCourseList.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass="App\Repository\PaidCourseListRepository")
  8. */
  9. class PaidCourseList
  10. {
  11. /**
  12. * @ORM\Id()
  13. * @ORM\GeneratedValue()
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(type="datetime")
  19. */
  20. private $courseDate;
  21. /**
  22. * @ORM\ManyToOne(targetEntity="App\Entity\TeacherSchedule", inversedBy="courseList")
  23. * @ORM\JoinColumn(nullable=false)
  24. */
  25. private $teacherSchedule;
  26. /**
  27. * @ORM\ManyToOne(targetEntity="App\Entity\SubscriptionOrder", inversedBy="coursesList")
  28. */
  29. private $subscriptionOrder;
  30. /**
  31. * @ORM\Column(type="datetime", nullable=true)
  32. */
  33. private $paymentDate;
  34. /**
  35. * @ORM\Column(type="boolean")
  36. */
  37. private $isDone;
  38. /**
  39. * @ORM\Column(type="boolean")
  40. */
  41. private $isCanceled;
  42. /**
  43. * @ORM\OneToOne(targetEntity="App\Entity\AbsenceLog", mappedBy="courseToCatchUp", cascade={"persist", "remove"})
  44. */
  45. private $absenceLog;
  46. /**
  47. * @ORM\Column(type="boolean")
  48. */
  49. private $isCatchable;
  50. /**
  51. * @ORM\OneToOne(targetEntity="App\Entity\SubscriptionLessonReport", mappedBy="courseDate", cascade={"persist", "remove"})
  52. */
  53. private $subscriptionLessonReport;
  54. /**
  55. * @ORM\OneToOne(targetEntity="App\Entity\AbsenceLog", cascade={"persist", "remove"})
  56. */
  57. private $absenceLogRelated;
  58. /**
  59. * @ORM\Column(type="boolean")
  60. */
  61. private $isCatchUpDate;
  62. /**
  63. * @ORM\ManyToOne(targetEntity="App\Entity\Session", inversedBy="courseList")
  64. */
  65. private $sessionGroup;
  66. /**
  67. * @ORM\Column(type="boolean")
  68. */
  69. private $isForGroup;
  70. /**
  71. * @ORM\Column(type="boolean")
  72. */
  73. private $isWaiting;
  74. /**
  75. * @ORM\Column(type="integer", nullable=true)
  76. */
  77. private $lostMinutes;
  78. /**
  79. * @ORM\Column(type="integer", nullable=true)
  80. */
  81. private $CatchUpMinutes;
  82. /**
  83. * @ORM\Column(type="string", length=255, nullable=true)
  84. */
  85. private $comment;
  86. /**
  87. * @ORM\OneToMany(targetEntity="App\Entity\TeacherSalary", mappedBy="courseDate")
  88. */
  89. private $teacherSalaries;
  90. /**
  91. * @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
  92. */
  93. private $price;
  94. /**
  95. * @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
  96. */
  97. private $penalty;
  98. /**
  99. * @ORM\OneToMany(targetEntity="App\Entity\GroupCourseLessonReport", mappedBy="courseDate")
  100. */
  101. private $groupCourseLessonReports;
  102. /**
  103. * @ORM\Column(type="boolean", nullable=true)
  104. */
  105. private $isAbandoned;
  106. /**
  107. * @ORM\Column(type="boolean", nullable=true)
  108. */
  109. private $isCanceledByStudent;
  110. /**
  111. * @ORM\Column(type="boolean", nullable=true)
  112. */
  113. private $isCanceledByUs;
  114. /**
  115. * @ORM\Column(type="datetime", nullable=true)
  116. */
  117. private $updateAt;
  118. /**
  119. * @ORM\Column(type="string", length=100, nullable=true)
  120. */
  121. private $updateBy;
  122. /**
  123. * @ORM\Column(type="boolean", nullable=true)
  124. */
  125. private $isCanceledForHoliday;
  126. /**
  127. * @ORM\ManyToOne(targetEntity="App\Entity\VideoCoursesRegistration", inversedBy="paidCourseLists")
  128. */
  129. private $videoRegistration;
  130. /**
  131. * @ORM\ManyToOne(targetEntity="App\Entity\TicketOrder", inversedBy="paidCourseLists")
  132. */
  133. private $ticketOrder;
  134. /**
  135. * @ORM\Column(type="boolean", nullable=true)
  136. */
  137. private $isTest;
  138. /**
  139. * @ORM\ManyToOne(targetEntity=UserPlacementTest::class, inversedBy="paidCourseLists")
  140. */
  141. private $userTestLevel;
  142. public function __construct()
  143. {
  144. $this->teacherSalaries = new ArrayCollection();
  145. $this->groupCourseLessonReports = new ArrayCollection();
  146. }
  147. public function getId(): ?int
  148. {
  149. return $this->id;
  150. }
  151. public function getCourseDate(): ?\DateTimeInterface
  152. {
  153. return $this->courseDate;
  154. }
  155. public function setCourseDate(\DateTimeInterface $courseDate): self
  156. {
  157. $this->courseDate = $courseDate;
  158. return $this;
  159. }
  160. public function getTeacherSchedule(): ?TeacherSchedule
  161. {
  162. return $this->teacherSchedule;
  163. }
  164. public function setTeacherSchedule(?TeacherSchedule $teacherSchedule): self
  165. {
  166. $this->teacherSchedule = $teacherSchedule;
  167. return $this;
  168. }
  169. public function getSubscriptionOrder(): ?SubscriptionOrder
  170. {
  171. return $this->subscriptionOrder;
  172. }
  173. public function setSubscriptionOrder(?SubscriptionOrder $subscriptionOrder): self
  174. {
  175. $this->subscriptionOrder = $subscriptionOrder;
  176. return $this;
  177. }
  178. public function getPaymentDate(): ?\DateTimeInterface
  179. {
  180. return $this->paymentDate;
  181. }
  182. public function setPaymentDate(?\DateTimeInterface $paymentDate): self
  183. {
  184. $this->paymentDate = $paymentDate;
  185. return $this;
  186. }
  187. public function getIsDone(): ?bool
  188. {
  189. return $this->isDone;
  190. }
  191. public function setIsDone(?bool $isDone): self
  192. {
  193. $this->isDone = $isDone;
  194. return $this;
  195. }
  196. public function getIsCanceled(): ?bool
  197. {
  198. return $this->isCanceled;
  199. }
  200. public function setIsCanceled(?bool $isCanceled): self
  201. {
  202. $this->isCanceled = $isCanceled;
  203. return $this;
  204. }
  205. public function getAbsenceLog(): ?AbsenceLog
  206. {
  207. return $this->absenceLog;
  208. }
  209. public function setAbsenceLog(AbsenceLog $absenceLog): self
  210. {
  211. $this->absenceLog = $absenceLog;
  212. // set the owning side of the relation if necessary
  213. if ($this !== $absenceLog->getCourseToCatchUp()) {
  214. $absenceLog->setCourseToCatchUp($this);
  215. }
  216. return $this;
  217. }
  218. public function cancelCourse()
  219. {
  220. $this->isDone = false;
  221. $this->isCanceled = true;
  222. }
  223. public function getIsCatchable(): ?bool
  224. {
  225. return $this->isCatchable;
  226. }
  227. public function setIsCatchable(?bool $isCatchable): self
  228. {
  229. $this->isCatchable = $isCatchable;
  230. return $this;
  231. }
  232. public function getSubscriptionLessonReport(): ?SubscriptionLessonReport
  233. {
  234. return $this->subscriptionLessonReport;
  235. }
  236. public function setSubscriptionLessonReport(?SubscriptionLessonReport $subscriptionLessonReport): self
  237. {
  238. $this->subscriptionLessonReport = $subscriptionLessonReport;
  239. // set (or unset) the owning side of the relation if necessary
  240. $newCourseDate = $subscriptionLessonReport === null ? null : $this;
  241. if ($newCourseDate !== $subscriptionLessonReport->getCourseDate()) {
  242. $subscriptionLessonReport->setCourseDate($newCourseDate);
  243. }
  244. return $this;
  245. }
  246. public function getAbsenceLogRelated(): ?AbsenceLog
  247. {
  248. return $this->absenceLogRelated;
  249. }
  250. public function setAbsenceLogRelated(?AbsenceLog $absenceLogRelated): self
  251. {
  252. $this->absenceLogRelated = $absenceLogRelated;
  253. return $this;
  254. }
  255. public function getIsCatchUpDate(): ?bool
  256. {
  257. return $this->isCatchUpDate;
  258. }
  259. public function setIsCatchUpDate(?bool $isCatchUpDate): self
  260. {
  261. $this->isCatchUpDate = $isCatchUpDate;
  262. return $this;
  263. }
  264. public function dateToString()
  265. {
  266. return $this->getCourseDate()->format('d/m/Y');
  267. }
  268. public function __toString()
  269. {
  270. return $this->dateToString();
  271. }
  272. public function getSessionGroup(): ?Session
  273. {
  274. return $this->sessionGroup;
  275. }
  276. public function setSessionGroup(?Session $sessionGroup): self
  277. {
  278. $this->sessionGroup = $sessionGroup;
  279. return $this;
  280. }
  281. public function getIsForGroup(): ?bool
  282. {
  283. return $this->isForGroup;
  284. }
  285. public function setIsForGroup(?bool $isForGroup): self
  286. {
  287. $this->isForGroup = $isForGroup;
  288. return $this;
  289. }
  290. public function getIsWaiting(): ?bool
  291. {
  292. return $this->isWaiting;
  293. }
  294. public function setIsWaiting(?bool $isWaiting): self
  295. {
  296. $this->isWaiting = $isWaiting;
  297. return $this;
  298. }
  299. public function getLostMinutes(): ?int
  300. {
  301. return $this->lostMinutes;
  302. }
  303. public function setLostMinutes(?int $lostMinutes): self
  304. {
  305. $this->lostMinutes = $lostMinutes;
  306. return $this;
  307. }
  308. public function getCatchUpMinutes(): ?int
  309. {
  310. return $this->CatchUpMinutes;
  311. }
  312. public function setCatchUpMinutes(?int $CatchUpMinutes): self
  313. {
  314. $this->CatchUpMinutes = $CatchUpMinutes;
  315. return $this;
  316. }
  317. public function getComment(): ?string
  318. {
  319. return $this->comment;
  320. }
  321. public function setComment(?string $comment): self
  322. {
  323. $this->comment = $comment;
  324. return $this;
  325. }
  326. /**
  327. * @return Collection|TeacherSalary[]
  328. */
  329. public function getTeacherSalaries(): Collection
  330. {
  331. return $this->teacherSalaries;
  332. }
  333. public function addTeacherSalary(TeacherSalary $teacherSalary): self
  334. {
  335. if (!$this->teacherSalaries->contains($teacherSalary)) {
  336. $this->teacherSalaries[] = $teacherSalary;
  337. $teacherSalary->setCourseDate($this);
  338. }
  339. return $this;
  340. }
  341. public function removeTeacherSalary(TeacherSalary $teacherSalary): self
  342. {
  343. if ($this->teacherSalaries->contains($teacherSalary)) {
  344. $this->teacherSalaries->removeElement($teacherSalary);
  345. // set the owning side to null (unless already changed)
  346. if ($teacherSalary->getCourseDate() === $this) {
  347. $teacherSalary->setCourseDate(null);
  348. }
  349. }
  350. return $this;
  351. }
  352. public function getPrice(): ?float
  353. {
  354. return $this->price;
  355. }
  356. public function setPrice(?float $price): self
  357. {
  358. $this->price = round($price, 2);
  359. return $this;
  360. }
  361. public function getPenalty(): ?float
  362. {
  363. return $this->penalty;
  364. }
  365. public function setPenalty(?float $penalty): self
  366. {
  367. $this->penalty = round($penalty, 2);
  368. return $this;
  369. }
  370. /**
  371. * @return Collection|GroupCourseLessonReport[]
  372. */
  373. public function getGroupCourseLessonReports(): Collection
  374. {
  375. return $this->groupCourseLessonReports;
  376. }
  377. public function addGroupCourseLessonReport(GroupCourseLessonReport $groupCourseLessonReport): self
  378. {
  379. if (!$this->groupCourseLessonReports->contains($groupCourseLessonReport)) {
  380. $this->groupCourseLessonReports[] = $groupCourseLessonReport;
  381. $groupCourseLessonReport->setCourseDate($this);
  382. }
  383. return $this;
  384. }
  385. public function removeGroupCourseLessonReport(GroupCourseLessonReport $groupCourseLessonReport): self
  386. {
  387. if ($this->groupCourseLessonReports->contains($groupCourseLessonReport)) {
  388. $this->groupCourseLessonReports->removeElement($groupCourseLessonReport);
  389. // set the owning side to null (unless already changed)
  390. if ($groupCourseLessonReport->getCourseDate() === $this) {
  391. $groupCourseLessonReport->setCourseDate(null);
  392. }
  393. }
  394. return $this;
  395. }
  396. public function getIsAbandoned(): ?bool
  397. {
  398. return $this->isAbandoned;
  399. }
  400. public function setIsAbandoned(?bool $isAbandoned): self
  401. {
  402. $this->isAbandoned = $isAbandoned;
  403. return $this;
  404. }
  405. public function getIsCanceledByStudent(): ?bool
  406. {
  407. return $this->isCanceledByStudent;
  408. }
  409. public function setIsCanceledByStudent(?bool $isCanceledByStudent): self
  410. {
  411. $this->isCanceledByStudent = $isCanceledByStudent;
  412. return $this;
  413. }
  414. public function getIsCanceledByUs(): ?bool
  415. {
  416. return $this->isCanceledByUs;
  417. }
  418. public function setIsCanceledByUs(?bool $isCanceledByUs): self
  419. {
  420. $this->isCanceledByUs = $isCanceledByUs;
  421. return $this;
  422. }
  423. public function getUpdateAt(): ?\DateTimeInterface
  424. {
  425. return $this->updateAt;
  426. }
  427. public function setUpdateAt(?\DateTimeInterface $updateAt): self
  428. {
  429. $this->updateAt = $updateAt;
  430. return $this;
  431. }
  432. public function getUpdateBy(): ?string
  433. {
  434. return $this->updateBy;
  435. }
  436. public function setUpdateBy(?string $updateBy): self
  437. {
  438. $this->updateBy = $updateBy;
  439. return $this;
  440. }
  441. public function getIsCanceledForHoliday(): ?bool
  442. {
  443. return $this->isCanceledForHoliday;
  444. }
  445. public function setIsCanceledForHoliday(?bool $isCanceledForHoliday): self
  446. {
  447. $this->isCanceledForHoliday = $isCanceledForHoliday;
  448. return $this;
  449. }
  450. public function getVideoRegistration(): ?VideoCoursesRegistration
  451. {
  452. return $this->videoRegistration;
  453. }
  454. public function setVideoRegistration(?VideoCoursesRegistration $videoRegistration): self
  455. {
  456. $this->videoRegistration = $videoRegistration;
  457. return $this;
  458. }
  459. public function getTicketOrder(): ?TicketOrder
  460. {
  461. return $this->ticketOrder;
  462. }
  463. public function setTicketOrder(?TicketOrder $ticketOrder): self
  464. {
  465. $this->ticketOrder = $ticketOrder;
  466. return $this;
  467. }
  468. public function getIsTest(): ?bool
  469. {
  470. return $this->isTest;
  471. }
  472. public function setIsTest(?bool $isTest): self
  473. {
  474. $this->isTest = $isTest;
  475. return $this;
  476. }
  477. public function getUserTestLevel(): ?UserPlacementTest
  478. {
  479. return $this->userTestLevel;
  480. }
  481. public function setUserTestLevel(?UserPlacementTest $userTestLevel): self
  482. {
  483. $this->userTestLevel = $userTestLevel;
  484. return $this;
  485. }
  486. }