<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\PaidCourseListRepository")
*/
class PaidCourseList
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime")
*/
private $courseDate;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\TeacherSchedule", inversedBy="courseList")
* @ORM\JoinColumn(nullable=false)
*/
private $teacherSchedule;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\SubscriptionOrder", inversedBy="coursesList")
*/
private $subscriptionOrder;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $paymentDate;
/**
* @ORM\Column(type="boolean")
*/
private $isDone;
/**
* @ORM\Column(type="boolean")
*/
private $isCanceled;
/**
* @ORM\OneToOne(targetEntity="App\Entity\AbsenceLog", mappedBy="courseToCatchUp", cascade={"persist", "remove"})
*/
private $absenceLog;
/**
* @ORM\Column(type="boolean")
*/
private $isCatchable;
/**
* @ORM\OneToOne(targetEntity="App\Entity\SubscriptionLessonReport", mappedBy="courseDate", cascade={"persist", "remove"})
*/
private $subscriptionLessonReport;
/**
* @ORM\OneToOne(targetEntity="App\Entity\AbsenceLog", cascade={"persist", "remove"})
*/
private $absenceLogRelated;
/**
* @ORM\Column(type="boolean")
*/
private $isCatchUpDate;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Session", inversedBy="courseList")
*/
private $sessionGroup;
/**
* @ORM\Column(type="boolean")
*/
private $isForGroup;
/**
* @ORM\Column(type="boolean")
*/
private $isWaiting;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $lostMinutes;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $CatchUpMinutes;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $comment;
/**
* @ORM\OneToMany(targetEntity="App\Entity\TeacherSalary", mappedBy="courseDate")
*/
private $teacherSalaries;
/**
* @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
*/
private $price;
/**
* @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
*/
private $penalty;
/**
* @ORM\OneToMany(targetEntity="App\Entity\GroupCourseLessonReport", mappedBy="courseDate")
*/
private $groupCourseLessonReports;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isAbandoned;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isCanceledByStudent;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isCanceledByUs;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updateAt;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $updateBy;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isCanceledForHoliday;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\VideoCoursesRegistration", inversedBy="paidCourseLists")
*/
private $videoRegistration;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\TicketOrder", inversedBy="paidCourseLists")
*/
private $ticketOrder;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isTest;
/**
* @ORM\ManyToOne(targetEntity=UserPlacementTest::class, inversedBy="paidCourseLists")
*/
private $userTestLevel;
public function __construct()
{
$this->teacherSalaries = new ArrayCollection();
$this->groupCourseLessonReports = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCourseDate(): ?\DateTimeInterface
{
return $this->courseDate;
}
public function setCourseDate(\DateTimeInterface $courseDate): self
{
$this->courseDate = $courseDate;
return $this;
}
public function getTeacherSchedule(): ?TeacherSchedule
{
return $this->teacherSchedule;
}
public function setTeacherSchedule(?TeacherSchedule $teacherSchedule): self
{
$this->teacherSchedule = $teacherSchedule;
return $this;
}
public function getSubscriptionOrder(): ?SubscriptionOrder
{
return $this->subscriptionOrder;
}
public function setSubscriptionOrder(?SubscriptionOrder $subscriptionOrder): self
{
$this->subscriptionOrder = $subscriptionOrder;
return $this;
}
public function getPaymentDate(): ?\DateTimeInterface
{
return $this->paymentDate;
}
public function setPaymentDate(?\DateTimeInterface $paymentDate): self
{
$this->paymentDate = $paymentDate;
return $this;
}
public function getIsDone(): ?bool
{
return $this->isDone;
}
public function setIsDone(?bool $isDone): self
{
$this->isDone = $isDone;
return $this;
}
public function getIsCanceled(): ?bool
{
return $this->isCanceled;
}
public function setIsCanceled(?bool $isCanceled): self
{
$this->isCanceled = $isCanceled;
return $this;
}
public function getAbsenceLog(): ?AbsenceLog
{
return $this->absenceLog;
}
public function setAbsenceLog(AbsenceLog $absenceLog): self
{
$this->absenceLog = $absenceLog;
// set the owning side of the relation if necessary
if ($this !== $absenceLog->getCourseToCatchUp()) {
$absenceLog->setCourseToCatchUp($this);
}
return $this;
}
public function cancelCourse()
{
$this->isDone = false;
$this->isCanceled = true;
}
public function getIsCatchable(): ?bool
{
return $this->isCatchable;
}
public function setIsCatchable(?bool $isCatchable): self
{
$this->isCatchable = $isCatchable;
return $this;
}
public function getSubscriptionLessonReport(): ?SubscriptionLessonReport
{
return $this->subscriptionLessonReport;
}
public function setSubscriptionLessonReport(?SubscriptionLessonReport $subscriptionLessonReport): self
{
$this->subscriptionLessonReport = $subscriptionLessonReport;
// set (or unset) the owning side of the relation if necessary
$newCourseDate = $subscriptionLessonReport === null ? null : $this;
if ($newCourseDate !== $subscriptionLessonReport->getCourseDate()) {
$subscriptionLessonReport->setCourseDate($newCourseDate);
}
return $this;
}
public function getAbsenceLogRelated(): ?AbsenceLog
{
return $this->absenceLogRelated;
}
public function setAbsenceLogRelated(?AbsenceLog $absenceLogRelated): self
{
$this->absenceLogRelated = $absenceLogRelated;
return $this;
}
public function getIsCatchUpDate(): ?bool
{
return $this->isCatchUpDate;
}
public function setIsCatchUpDate(?bool $isCatchUpDate): self
{
$this->isCatchUpDate = $isCatchUpDate;
return $this;
}
public function dateToString()
{
return $this->getCourseDate()->format('d/m/Y');
}
public function __toString()
{
return $this->dateToString();
}
public function getSessionGroup(): ?Session
{
return $this->sessionGroup;
}
public function setSessionGroup(?Session $sessionGroup): self
{
$this->sessionGroup = $sessionGroup;
return $this;
}
public function getIsForGroup(): ?bool
{
return $this->isForGroup;
}
public function setIsForGroup(?bool $isForGroup): self
{
$this->isForGroup = $isForGroup;
return $this;
}
public function getIsWaiting(): ?bool
{
return $this->isWaiting;
}
public function setIsWaiting(?bool $isWaiting): self
{
$this->isWaiting = $isWaiting;
return $this;
}
public function getLostMinutes(): ?int
{
return $this->lostMinutes;
}
public function setLostMinutes(?int $lostMinutes): self
{
$this->lostMinutes = $lostMinutes;
return $this;
}
public function getCatchUpMinutes(): ?int
{
return $this->CatchUpMinutes;
}
public function setCatchUpMinutes(?int $CatchUpMinutes): self
{
$this->CatchUpMinutes = $CatchUpMinutes;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
/**
* @return Collection|TeacherSalary[]
*/
public function getTeacherSalaries(): Collection
{
return $this->teacherSalaries;
}
public function addTeacherSalary(TeacherSalary $teacherSalary): self
{
if (!$this->teacherSalaries->contains($teacherSalary)) {
$this->teacherSalaries[] = $teacherSalary;
$teacherSalary->setCourseDate($this);
}
return $this;
}
public function removeTeacherSalary(TeacherSalary $teacherSalary): self
{
if ($this->teacherSalaries->contains($teacherSalary)) {
$this->teacherSalaries->removeElement($teacherSalary);
// set the owning side to null (unless already changed)
if ($teacherSalary->getCourseDate() === $this) {
$teacherSalary->setCourseDate(null);
}
}
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(?float $price): self
{
$this->price = round($price, 2);
return $this;
}
public function getPenalty(): ?float
{
return $this->penalty;
}
public function setPenalty(?float $penalty): self
{
$this->penalty = round($penalty, 2);
return $this;
}
/**
* @return Collection|GroupCourseLessonReport[]
*/
public function getGroupCourseLessonReports(): Collection
{
return $this->groupCourseLessonReports;
}
public function addGroupCourseLessonReport(GroupCourseLessonReport $groupCourseLessonReport): self
{
if (!$this->groupCourseLessonReports->contains($groupCourseLessonReport)) {
$this->groupCourseLessonReports[] = $groupCourseLessonReport;
$groupCourseLessonReport->setCourseDate($this);
}
return $this;
}
public function removeGroupCourseLessonReport(GroupCourseLessonReport $groupCourseLessonReport): self
{
if ($this->groupCourseLessonReports->contains($groupCourseLessonReport)) {
$this->groupCourseLessonReports->removeElement($groupCourseLessonReport);
// set the owning side to null (unless already changed)
if ($groupCourseLessonReport->getCourseDate() === $this) {
$groupCourseLessonReport->setCourseDate(null);
}
}
return $this;
}
public function getIsAbandoned(): ?bool
{
return $this->isAbandoned;
}
public function setIsAbandoned(?bool $isAbandoned): self
{
$this->isAbandoned = $isAbandoned;
return $this;
}
public function getIsCanceledByStudent(): ?bool
{
return $this->isCanceledByStudent;
}
public function setIsCanceledByStudent(?bool $isCanceledByStudent): self
{
$this->isCanceledByStudent = $isCanceledByStudent;
return $this;
}
public function getIsCanceledByUs(): ?bool
{
return $this->isCanceledByUs;
}
public function setIsCanceledByUs(?bool $isCanceledByUs): self
{
$this->isCanceledByUs = $isCanceledByUs;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->updateAt;
}
public function setUpdateAt(?\DateTimeInterface $updateAt): self
{
$this->updateAt = $updateAt;
return $this;
}
public function getUpdateBy(): ?string
{
return $this->updateBy;
}
public function setUpdateBy(?string $updateBy): self
{
$this->updateBy = $updateBy;
return $this;
}
public function getIsCanceledForHoliday(): ?bool
{
return $this->isCanceledForHoliday;
}
public function setIsCanceledForHoliday(?bool $isCanceledForHoliday): self
{
$this->isCanceledForHoliday = $isCanceledForHoliday;
return $this;
}
public function getVideoRegistration(): ?VideoCoursesRegistration
{
return $this->videoRegistration;
}
public function setVideoRegistration(?VideoCoursesRegistration $videoRegistration): self
{
$this->videoRegistration = $videoRegistration;
return $this;
}
public function getTicketOrder(): ?TicketOrder
{
return $this->ticketOrder;
}
public function setTicketOrder(?TicketOrder $ticketOrder): self
{
$this->ticketOrder = $ticketOrder;
return $this;
}
public function getIsTest(): ?bool
{
return $this->isTest;
}
public function setIsTest(?bool $isTest): self
{
$this->isTest = $isTest;
return $this;
}
public function getUserTestLevel(): ?UserPlacementTest
{
return $this->userTestLevel;
}
public function setUserTestLevel(?UserPlacementTest $userTestLevel): self
{
$this->userTestLevel = $userTestLevel;
return $this;
}
}