<?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\GroupRepository")
* @ORM\HasLifecycleCallbacks()
*/
class SessionOrder
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime")
*/
private $purchaseDate;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Session", inversedBy="sessionOrder")
* @ORM\JoinColumn(nullable=false)
*/
private $session;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="sessionOrder")
*/
private $students;
/**
* @ORM\Column(type="string", length=255)
*/
private $stripeCustomerId;
/**
* @ORM\OneToMany(targetEntity="App\Entity\AbsenceLog", mappedBy="groupSession")
*/
private $absenceLogs;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Child", inversedBy="sessionOrders")
*/
private $participant;
/**
* @ORM\Column(type="decimal", precision=25, scale=15)
*/
private $amountPaid;
/**
* @ORM\OneToMany(targetEntity="App\Entity\GroupCourseLessonReport", mappedBy="sessionOrder")
*/
private $groupCourseLessonReports;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $canceledByUs;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $canceledByStudent;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isActif;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $canceledAt;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Homework", mappedBy="RelatedToGroupCourses")
*/
private $homeworks;
/**
* @ORM\Column(type="boolean")
*/
private $isTwoTime;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $paymentNb;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $cardBrand;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $cardLast4;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nextPaymentTimeStamp;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $stripeSubscriptionId;
/**
* @ORM\OneToMany(targetEntity="App\Entity\EmailListSubscribeLostLog", mappedBy="sessionOrder")
*/
private $subscribeLostLogs;
/**
* @ORM\OneToMany(targetEntity="App\Entity\EmailListUnsubscribeLog", mappedBy="sessionOrder")
*/
private $unsubscribeLogs;
/**
* @ORM\OneToMany(targetEntity=UserPlacementTest::class, mappedBy="sessionOrder")
*/
private $userPlacementTests;
/**
* @ORM\OneToMany(targetEntity=Exam::class, mappedBy="relatedToGroupCourses")
*/
private $exams;
/**
* @ORM\OneToMany(targetEntity=TrainingReport::class, mappedBy="relatedToGroupCourse")
*/
private $trainingReports;
/**
* @ORM\Column(type="string", length=3, nullable=true)
*/
private $paymentCurrency;
/**
* @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
*/
private $amountPaidLocalCurrency;
/**
* @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
*/
private $amountReceivedUsd;
/**
* @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
*/
private $stripeFees;
public function __construct()
{
$this->absenceLogs = new ArrayCollection();
$this->groupCourseLessonReports = new ArrayCollection();
$this->homeworks = new ArrayCollection();
$this->subscribeLostLogs = new ArrayCollection();
$this->unsubscribeLogs = new ArrayCollection();
$this->userPlacementTests = new ArrayCollection();
$this->exams = new ArrayCollection();
$this->trainingReports = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPurchaseDate(): ?\DateTimeInterface
{
return $this->purchaseDate;
}
public function setPurchaseDate(\DateTimeInterface $purchaseDate): self
{
$this->purchaseDate = $purchaseDate;
return $this;
}
/**
* @ORM\PrePersist()
*
* @return void
*/
public function setPurchaseDateOnPersist()
{
$this->purchaseDate = new \DateTime();
}
public function getSession(): ?Session
{
return $this->session;
}
public function setSession(?Session $session): self
{
$this->session = $session;
return $this;
}
public function getStudents(): ?User
{
return $this->students;
}
public function setStudents(?User $students): self
{
$this->students = $students;
return $this;
}
public function getStripeCustomerId(): ?string
{
return $this->stripeCustomerId;
}
public function setStripeCustomerId(string $stripeCustomerId): self
{
$this->stripeCustomerId = $stripeCustomerId;
return $this;
}
/**
* @return Collection|AbsenceLog[]
*/
public function getAbsenceLogs(): Collection
{
return $this->absenceLogs;
}
public function addAbsenceLog(AbsenceLog $absenceLog): self
{
if (!$this->absenceLogs->contains($absenceLog)) {
$this->absenceLogs[] = $absenceLog;
$absenceLog->setGroupSession($this);
}
return $this;
}
public function removeAbsenceLog(AbsenceLog $absenceLog): self
{
if ($this->absenceLogs->contains($absenceLog)) {
$this->absenceLogs->removeElement($absenceLog);
// set the owning side to null (unless already changed)
if ($absenceLog->getGroupSession() === $this) {
$absenceLog->setGroupSession(null);
}
}
return $this;
}
public function getParticipant(): ?Child
{
return $this->participant;
}
public function setParticipant(?Child $participant): self
{
$this->participant = $participant;
return $this;
}
public function getAmountPaid(): ?float
{
return $this->amountPaid;
}
public function setAmountPaid(float $amountPaid): self
{
$this->amountPaid = round($amountPaid, 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->setSessionOrder($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->getSessionOrder() === $this) {
$groupCourseLessonReport->setSessionOrder(null);
}
}
return $this;
}
public function getCanceledByUs(): ?bool
{
return $this->canceledByUs;
}
public function setCanceledByUs(?bool $canceledByUs): self
{
$this->canceledByUs = $canceledByUs;
return $this;
}
public function getCanceledByStudent(): ?bool
{
return $this->canceledByStudent;
}
public function setCanceledByStudent(?bool $canceledByStudent): self
{
$this->canceledByStudent = $canceledByStudent;
return $this;
}
public function getIsActif(): ?bool
{
return $this->isActif;
}
public function setIsActif(?bool $isActif): self
{
$this->isActif = $isActif;
return $this;
}
public function getCanceledAt(): ?\DateTimeInterface
{
return $this->canceledAt;
}
public function setCanceledAt(?\DateTimeInterface $canceledAt): self
{
$this->canceledAt = $canceledAt;
return $this;
}
public function __toString()
{
return $this->getStudents()->getFullname();
}
/**
* @return Collection|Homework[]
*/
public function getHomeworks(): Collection
{
return $this->homeworks;
}
public function addHomework(Homework $homework): self
{
if (!$this->homeworks->contains($homework)) {
$this->homeworks[] = $homework;
$homework->setRelatedToGroupCourses($this);
}
return $this;
}
public function removeHomework(Homework $homework): self
{
if ($this->homeworks->contains($homework)) {
$this->homeworks->removeElement($homework);
// set the owning side to null (unless already changed)
if ($homework->getRelatedToGroupCourses() === $this) {
$homework->setRelatedToGroupCourses(null);
}
}
return $this;
}
public function getIsTwoTime(): ?bool
{
return $this->isTwoTime;
}
public function setIsTwoTime(bool $isTwoTime): self
{
$this->isTwoTime = $isTwoTime;
return $this;
}
public function getPaymentNb(): ?int
{
return $this->paymentNb;
}
public function setPaymentNb(?int $paymentNb): self
{
$this->paymentNb = $paymentNb;
return $this;
}
public function getCardBrand(): ?string
{
return $this->cardBrand;
}
public function setCardBrand(?string $cardBrand): self
{
$this->cardBrand = $cardBrand;
return $this;
}
public function getCardLast4(): ?string
{
return $this->cardLast4;
}
public function setCardLast4(?string $cardLast4): self
{
$this->cardLast4 = $cardLast4;
return $this;
}
public function getNextPaymentTimeStamp(): ?string
{
return $this->nextPaymentTimeStamp;
}
public function setNextPaymentTimeStamp(?string $nextPaymentTimeStamp): self
{
$this->nextPaymentTimeStamp = $nextPaymentTimeStamp;
return $this;
}
public function getStripeSubscriptionId(): ?string
{
return $this->stripeSubscriptionId;
}
public function setStripeSubscriptionId(?string $stripeSubscriptionId): self
{
$this->stripeSubscriptionId = $stripeSubscriptionId;
return $this;
}
/**
* @return Collection|EmailListSubscribeLostLog[]
*/
public function getSubscribeLostLogs(): Collection
{
return $this->subscribeLostLogs;
}
public function addSubscribeLostLog(EmailListSubscribeLostLog $subscribeLostLog): self
{
if (!$this->subscribeLostLogs->contains($subscribeLostLog)) {
$this->subscribeLostLogs[] = $subscribeLostLog;
$subscribeLostLog->setSessionOrder($this);
}
return $this;
}
public function removeSubscribeLostLog(EmailListSubscribeLostLog $subscribeLostLog): self
{
if ($this->subscribeLostLogs->removeElement($subscribeLostLog)) {
if ($subscribeLostLog->getSessionOrder() === $this) {
$subscribeLostLog->setSessionOrder(null);
}
}
return $this;
}
/**
* @return Collection|EmailListUnsubscribeLog[]
*/
public function getUnsubscribeLogs(): Collection
{
return $this->unsubscribeLogs;
}
public function addUnsubscribeLog(EmailListUnsubscribeLog $unsubscribeLog): self
{
if (!$this->unsubscribeLogs->contains($unsubscribeLog)) {
$this->unsubscribeLogs[] = $unsubscribeLog;
$unsubscribeLog->setSessionOrder($this);
}
return $this;
}
public function removeUnsubscribeLog(EmailListUnsubscribeLog $unsubscribeLog): self
{
if ($this->unsubscribeLogs->removeElement($unsubscribeLog)) {
if ($unsubscribeLog->getSessionOrder() === $this) {
$unsubscribeLog->setSessionOrder(null);
}
}
return $this;
}
/**
* @return Collection|UserPlacementTest[]
*/
public function getUserPlacementTests(): Collection
{
return $this->userPlacementTests;
}
public function addUserPlacementTest(UserPlacementTest $userPlacementTest): self
{
if (!$this->userPlacementTests->contains($userPlacementTest)) {
$this->userPlacementTests[] = $userPlacementTest;
$userPlacementTest->setSessionOrder($this);
}
return $this;
}
public function removeUserPlacementTest(UserPlacementTest $userPlacementTest): self
{
if ($this->userPlacementTests->removeElement($userPlacementTest)) {
// set the owning side to null (unless already changed)
if ($userPlacementTest->getSessionOrder() === $this) {
$userPlacementTest->setSessionOrder(null);
}
}
return $this;
}
/**
* @return Collection|Exam[]
*/
public function getExams(): Collection
{
return $this->exams;
}
public function addExam(Exam $exam): self
{
if (!$this->exams->contains($exam)) {
$this->exams[] = $exam;
$exam->setRelatedToGroupCourses($this);
}
return $this;
}
public function removeExam(Exam $exam): self
{
if ($this->exams->removeElement($exam)) {
// set the owning side to null (unless already changed)
if ($exam->getRelatedToGroupCourses() === $this) {
$exam->setRelatedToGroupCourses(null);
}
}
return $this;
}
/**
* @return Collection|TrainingReport[]
*/
public function getTrainingReports(): Collection
{
return $this->trainingReports;
}
public function addTrainingReport(TrainingReport $trainingReport): self
{
if (!$this->trainingReports->contains($trainingReport)) {
$this->trainingReports[] = $trainingReport;
$trainingReport->setRelatedToGroupCourse($this);
}
return $this;
}
public function removeTrainingReport(TrainingReport $trainingReport): self
{
if ($this->trainingReports->removeElement($trainingReport)) {
// set the owning side to null (unless already changed)
if ($trainingReport->getRelatedToGroupCourse() === $this) {
$trainingReport->setRelatedToGroupCourse(null);
}
}
return $this;
}
public function getPaymentCurrency(): ?string
{
return $this->paymentCurrency;
}
public function setPaymentCurrency(?string $paymentCurrency): self
{
$this->paymentCurrency = $paymentCurrency;
return $this;
}
public function getAmountPaidLocalCurrency(): ?float
{
return $this->amountPaidLocalCurrency;
}
public function setAmountPaidLocalCurrency(?float $amountPaidLocalCurrency): self
{
$this->amountPaidLocalCurrency = $amountPaidLocalCurrency ? round($amountPaidLocalCurrency, 2) : null;
return $this;
}
public function getAmountReceivedUsd(): ?float
{
return $this->amountReceivedUsd;
}
public function setAmountReceivedUsd(?float $amountReceivedUsd): self
{
$this->amountReceivedUsd = $amountReceivedUsd ? round($amountReceivedUsd, 2) : null;
return $this;
}
public function getStripeFees(): ?float
{
return $this->stripeFees;
}
public function setStripeFees(?float $stripeFees): self
{
$this->stripeFees = $stripeFees ? round($stripeFees, 2) : null;
return $this;
}
}