src/Entity/SubscriptionOrder.php line 16

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\Common\Collections\Criteria;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Symfony\Component\Validator\Context\ExecutionContextInterface;
  9. /**
  10.  * @ORM\Entity(repositoryClass="App\Repository\SubscriptionOrderRepository")
  11.  * @ORM\HasLifecycleCallbacks()
  12.  */
  13. class SubscriptionOrder
  14. {
  15.     /**
  16.      * @ORM\Id()
  17.      * @ORM\GeneratedValue()
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\Child", inversedBy="subscriptionOrders")
  23.      */
  24.     private $participant;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="subscriptionOrders")
  27.      * @ORM\JoinColumn(nullable=false)
  28.      */
  29.     private $user;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $customerId;
  34.     /**
  35.      * @ORM\Column(type="datetime")
  36.      */
  37.     private $purchaseDate;
  38.     /**
  39.      * @ORM\Column(type="datetime", nullable=true)
  40.      * use for track schedules change and limit the changes for 30 days
  41.      */
  42.     private $updateAt;
  43.     /**
  44.      * @ORM\Column(type="boolean")
  45.      */
  46.     private $isActif;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity="App\Entity\TeacherSchedule", mappedBy="subscriptionOrder")
  49.      */
  50.     private $schedules;
  51.     /**
  52.      * @ORM\ManyToOne(targetEntity="App\Entity\Plan", inversedBy="subscriptionOrders")
  53.      * @ORM\JoinColumn(nullable=false)
  54.      */
  55.     private $plan;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity="App\Entity\Teacher", inversedBy="subscriptionOrders")
  58.      * @ORM\JoinColumn(nullable=false)
  59.      */
  60.     private $teacher;
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="subscriptionOrders")
  63.      * @ORM\JoinColumn(nullable=false)
  64.      */
  65.     private $category;
  66.     /**
  67.      * @ORM\Column(type="datetime")
  68.      */
  69.     private $coursesStartAt;
  70.     /**
  71.      * @ORM\ManyToOne(targetEntity="App\Entity\Subject", inversedBy="subscriptionOrders")
  72.      */
  73.     private $subject;
  74.     /**
  75.      * @ORM\Column(type="integer")
  76.      */
  77.     private $catchUpRight;
  78.     /**
  79.      * @ORM\Column(type="datetime", nullable=true)
  80.      */
  81.     private $nextPaymentDate;
  82.     /**
  83.      * @ORM\OneToMany(targetEntity="App\Entity\PaidCourseList", mappedBy="subscriptionOrder")
  84.      */
  85.     private $coursesList;
  86.     /**
  87.      * @ORM\Column(type="string", length=100, nullable=true)
  88.      */
  89.     private $cardBrand;
  90.     /**
  91.      * @ORM\Column(type="string", length=50, nullable=true)
  92.      */
  93.     private $cardLast4;
  94.     /**
  95.      * @ORM\Column(type="string", length=255, nullable=true)
  96.      */
  97.     private $stripeSubscriptionId;
  98.     /**
  99.      * @ORM\Column(type="datetime", nullable=true)
  100.      */
  101.     private $renewBefore;
  102.     
  103.     /**
  104.      * @ORM\Column(type="boolean", nullable=true)
  105.      */
  106.     private $isCancelled;
  107.     /**
  108.      * @ORM\Column(type="integer")
  109.      */
  110.     private $nbOfScheduleChoose 1;
  111.     /**
  112.      * @ORM\Column(type="boolean", nullable=true)
  113.      */
  114.     private $isDue;
  115.     /**
  116.      * @ORM\Column(type="string", length=255, nullable=true)
  117.      */
  118.     private $nextPaymentTimeStamp;
  119.     /**
  120.      * @ORM\Column(type="datetime", nullable=true)
  121.      */
  122.     private $lastPaidCourse;
  123.     /**
  124.      * @ORM\OneToMany(targetEntity="App\Entity\PlanUpdateLog", mappedBy="subscription")
  125.      */
  126.     private $planUpdateLogs;
  127.     /**
  128.      * @ORM\OneToMany(targetEntity="App\Entity\AbsenceLog", mappedBy="subscription")
  129.      */
  130.     private $absenceLogs;
  131.     /**
  132.      * @ORM\OneToMany(targetEntity="App\Entity\SubscriptionLessonReport", mappedBy="subscription", orphanRemoval=true)
  133.      */
  134.     private $subscriptionLessonReports;
  135.     /**
  136.      * @ORM\Column(type="datetime", nullable=true)
  137.      */
  138.     private $cancellationDate;
  139.     /**
  140.      * @ORM\ManyToOne(targetEntity="App\Entity\SubjectLevel", inversedBy="subscriptionOrder")
  141.      */
  142.     private $subjectLevel;
  143.     /**
  144.      * @ORM\Column(type="decimal", precision=25, scale=15)
  145.      */
  146.     private $paidAmount;
  147.     /**
  148.      * @ORM\Column(type="integer", nullable=true)
  149.      */
  150.     private $TotalLostMinutes;
  151.     /**
  152.      * @ORM\OneToMany(targetEntity="App\Entity\Homework", mappedBy="RelatedToSubscription")
  153.      */
  154.     private $homeworks;
  155.     /**
  156.      * @ORM\Column(type="boolean", nullable=true)
  157.      */
  158.     private $haveRamadanCredit;
  159.     /**
  160.      * @ORM\Column(type="decimal", precision=25, scale=15, nullable=true)
  161.      */
  162.     private $ramadanCreditAmount;
  163.     /**
  164.      * @ORM\OneToMany(targetEntity="App\Entity\ActiveCampainSubscribeLostLog", mappedBy="subscription")
  165.      */
  166.     private $subscribeLostLogs;
  167.     /**
  168.      * @ORM\OneToMany(targetEntity="App\Entity\ActiveCampainUnsubscribeLog", mappedBy="subscription")
  169.      */
  170.     private $unsubscribeLogs;
  171.     /**
  172.      * @ORM\OneToMany(targetEntity=Exam::class, mappedBy="relatedToSubscription")
  173.      */
  174.     private $exams;
  175.     /**
  176.      * @ORM\OneToMany(targetEntity=TrainingReport::class, mappedBy="relatedToSubscription")
  177.      */
  178.     private $trainingReports;
  179.     public function __construct()
  180.     {
  181.         $this->schedules = new ArrayCollection();
  182.         $this->coursesList = new ArrayCollection();
  183.         $this->planUpdateLogs = new ArrayCollection();
  184.         $this->absenceLogs = new ArrayCollection();
  185.         $this->subscriptionLessonReports = new ArrayCollection();
  186.         $this->homeworks = new ArrayCollection();
  187.         $this->subscribeLostLogs = new ArrayCollection();
  188.         $this->unsubscribeLogs = new ArrayCollection();
  189.         $this->exams = new ArrayCollection();
  190.         $this->trainingReports = new ArrayCollection();
  191.     }
  192.     public function getId(): ?int
  193.     {
  194.         return $this->id;
  195.     }
  196.     public function getPurchaseDate(): ?\DateTimeInterface
  197.     {
  198.         return $this->purchaseDate;
  199.     }
  200.     public function setPurchaseDate(\DateTimeInterface $purchaseDate): self
  201.     {
  202.         $this->purchaseDate $purchaseDate;
  203.         return $this;
  204.     }
  205.     public function getCustomerId(): ?string
  206.     {
  207.         return $this->customerId;
  208.     }
  209.     public function setCustomerId(string $customerId): self
  210.     {
  211.         $this->customerId $customerId;
  212.         return $this;
  213.     }
  214.     public function getUpdateAt(): ?\DateTimeInterface
  215.     {
  216.         return $this->updateAt;
  217.     }
  218.     public function setUpdateAt(?\DateTimeInterface $updateAt): self
  219.     {
  220.         $this->updateAt $updateAt;
  221.         return $this;
  222.     }
  223.     public function getIsActif(): ?bool
  224.     {
  225.         return $this->isActif;
  226.     }
  227.     public function setIsActif(bool $isActif): self
  228.     {
  229.         $this->isActif $isActif;
  230.         return $this;
  231.     }
  232.     public function getParticipant(): ?Child
  233.     {
  234.         return $this->participant;
  235.     }
  236.     public function setParticipant(?Child $participant): self
  237.     {
  238.         $this->participant $participant;
  239.         return $this;
  240.     }
  241.     public function getUser(): ?User
  242.     {
  243.         return $this->user;
  244.     }
  245.     public function setUser(?User $user): self
  246.     {
  247.         $this->user $user;
  248.         return $this;
  249.     }
  250.     /**
  251.      * @return Collection|TeacherSchedule[]
  252.      */
  253.     public function getSchedules(): Collection
  254.     {
  255.         return $this->schedules;
  256.     }
  257.     public function addSchedule(TeacherSchedule $schedule): self
  258.     {
  259.         if (!$this->schedules->contains($schedule)) {
  260.             $this->schedules[] = $schedule;
  261.             $schedule->setSubscriptionOrder($this);
  262.         }
  263.         return $this;
  264.     }
  265.     public function removeSchedule(TeacherSchedule $schedule): self
  266.     {
  267.         if ($this->schedules->contains($schedule)) {
  268.             $this->schedules->removeElement($schedule);
  269.             // set the owning side to null (unless already changed)
  270.             if ($schedule->getSubscriptionOrder() === $this) {
  271.                 $schedule->setSubscriptionOrder(null);
  272.             }
  273.         }
  274.         return $this;
  275.     }
  276.     public function getPlan(): ?Plan
  277.     {
  278.         return $this->plan;
  279.     }
  280.     public function setPlan(?Plan $plan): self
  281.     {
  282.         $this->plan $plan;
  283.         return $this;
  284.     }
  285.     public function getTeacher(): ?Teacher
  286.     {
  287.         return $this->teacher;
  288.     }
  289.     public function setTeacher(?Teacher $teacher): self
  290.     {
  291.         $this->teacher $teacher;
  292.         return $this;
  293.     }
  294.     public function getCategory(): ?Category
  295.     {
  296.         return $this->category;
  297.     }
  298.     public function setCategory(?Category $category): self
  299.     {
  300.         $this->category $category;
  301.         return $this;
  302.     }
  303.     public function getCoursesStartAt(): ?\DateTimeInterface
  304.     {
  305.         return $this->coursesStartAt;
  306.     }
  307.     public function setCoursesStartAt(\DateTimeInterface $coursesStartAt): self
  308.     {
  309.         $this->coursesStartAt $coursesStartAt;
  310.         return $this;
  311.     }
  312.     public function getSubject(): ?Subject
  313.     {
  314.         return $this->subject;
  315.     }
  316.     public function setSubject(?Subject $subject): self
  317.     {
  318.         $this->subject $subject;
  319.         return $this;
  320.     }
  321.     public function getCatchUpRight(): ?int
  322.     {
  323.         return $this->catchUpRight;
  324.     }
  325.     public function setCatchUpRight(int $catchUpRight): self
  326.     {
  327.         $this->catchUpRight $catchUpRight;
  328.         return $this;
  329.     }
  330.     public function getNextPaymentDate(): ?\DateTimeInterface
  331.     {
  332.         return $this->nextPaymentDate;
  333.     }
  334.     public function setNextPaymentDate(?\DateTimeInterface $nextPaymentDate): self
  335.     {
  336.         $this->nextPaymentDate $nextPaymentDate;
  337.         return $this;
  338.     }
  339.     /**
  340.      * @return Collection|PaidCourseList[]
  341.      */
  342.     public function getCoursesList(): Collection
  343.     {
  344.         return $this->coursesList;
  345.     }
  346.     public function addCoursesList(PaidCourseList $coursesList): self
  347.     {
  348.         if (!$this->coursesList->contains($coursesList)) {
  349.             $this->coursesList[] = $coursesList;
  350.             $coursesList->setSubscriptionOrder($this);
  351.         }
  352.         return $this;
  353.     }
  354.     public function removeCoursesList(PaidCourseList $coursesList): self
  355.     {
  356.         if ($this->coursesList->contains($coursesList)) {
  357.             $this->coursesList->removeElement($coursesList);
  358.             // set the owning side to null (unless already changed)
  359.             if ($coursesList->getSubscriptionOrder() === $this) {
  360.                 $coursesList->setSubscriptionOrder(null);
  361.             }
  362.         }
  363.         return $this;
  364.     }
  365.     public function getCardBrand(): ?string
  366.     {
  367.         return $this->cardBrand;
  368.     }
  369.     public function setCardBrand(?string $cardBrand): self
  370.     {
  371.         $this->cardBrand $cardBrand;
  372.         return $this;
  373.     }
  374.     public function getCardLast4(): ?string
  375.     {
  376.         return $this->cardLast4;
  377.     }
  378.     public function setCardLast4(?string $cardLast4): self
  379.     {
  380.         $this->cardLast4 $cardLast4;
  381.         return $this;
  382.     }
  383.     public function getStripeSubscriptionId(): ?string
  384.     {
  385.         return $this->stripeSubscriptionId;
  386.     }
  387.     public function setStripeSubscriptionId(?string $stripeSubscriptionId): self
  388.     {
  389.         $this->stripeSubscriptionId $stripeSubscriptionId;
  390.         return $this;
  391.     }
  392.     public function getRenewBefore(): ?\DateTimeInterface
  393.     {
  394.         return $this->renewBefore;
  395.     }
  396.     public function setRenewBefore(?\DateTimeInterface $renewBefore): self
  397.     {
  398.         $this->renewBefore $renewBefore;
  399.         return $this;
  400.     }
  401.     public function cancel()
  402.     {
  403.         $this->isActif false;
  404.     }
  405.     public function makeDue()
  406.     {
  407.         $this->isDue true;
  408.     }
  409.     public function fullyCancel()
  410.     {
  411.         $this->isActif false;
  412.         $this->isCancelled true;
  413.         $this->isDue false;
  414.         $this->cancellationDate = new \DateTimeImmutable();
  415.     }
  416.     public function reactivate()
  417.     {
  418.         $this->isActif true;
  419.     }
  420.     public function getIsCancelled(): ?bool
  421.     {
  422.         return $this->isCancelled;
  423.     }
  424.     public function setIsCancelled(?bool $isCancelled): self
  425.     {
  426.         $this->isCancelled $isCancelled;
  427.         return $this;
  428.     }
  429.     public function getNbOfScheduleChoose(): int
  430.     {
  431.         return $this->nbOfScheduleChoose;
  432.     }
  433.     public function setNbOfScheduleChoose(int $nbOfScheduleChoose): self
  434.     {
  435.         $this->nbOfScheduleChoose $nbOfScheduleChoose;
  436.         return $this;
  437.     }
  438.     public function getIsDue(): ?bool
  439.     {
  440.         return $this->isDue;
  441.     }
  442.     public function setIsDue(?bool $isDue): self
  443.     {
  444.         $this->isDue $isDue;
  445.         return $this;
  446.     }
  447.     public function getNextPaymentTimeStamp(): ?string
  448.     {
  449.         return $this->nextPaymentTimeStamp;
  450.     }
  451.     public function setNextPaymentTimeStamp(?string $nextPaymentTimeStamp): self
  452.     {
  453.         $this->nextPaymentTimeStamp $nextPaymentTimeStamp;
  454.         return $this;
  455.     }
  456.     public function getLastPaidCourse(): ?\DateTimeInterface
  457.     {
  458.         return $this->lastPaidCourse;
  459.     }
  460.     public function setLastPaidCourse(?\DateTimeInterface $lastPaidCourse): self
  461.     {
  462.         $this->lastPaidCourse $lastPaidCourse;
  463.         return $this;
  464.     }
  465.     /**
  466.      * @return Collection|PlanUpdateLog[]
  467.      */
  468.     public function getPlanUpdateLogs(): Collection
  469.     {
  470.         return $this->planUpdateLogs;
  471.     }
  472.     public function addPlanUpdateLog(PlanUpdateLog $planUpdateLog): self
  473.     {
  474.         if (!$this->planUpdateLogs->contains($planUpdateLog)) {
  475.             $this->planUpdateLogs[] = $planUpdateLog;
  476.             $planUpdateLog->setSubscription($this);
  477.         }
  478.         return $this;
  479.     }
  480.     public function removePlanUpdateLog(PlanUpdateLog $planUpdateLog): self
  481.     {
  482.         if ($this->planUpdateLogs->contains($planUpdateLog)) {
  483.             $this->planUpdateLogs->removeElement($planUpdateLog);
  484.             // set the owning side to null (unless already changed)
  485.             if ($planUpdateLog->getSubscription() === $this) {
  486.                 $planUpdateLog->setSubscription(null);
  487.             }
  488.         }
  489.         return $this;
  490.     }
  491.     /**
  492.      * @return Collection|AbsenceLog[]
  493.      */
  494.     public function getAbsenceLogs(): Collection
  495.     {
  496.         return $this->absenceLogs;
  497.     }
  498.     public function addAbsenceLog(AbsenceLog $absenceLog): self
  499.     {
  500.         if (!$this->absenceLogs->contains($absenceLog)) {
  501.             $this->absenceLogs[] = $absenceLog;
  502.             $absenceLog->setSubscription($this);
  503.         }
  504.         return $this;
  505.     }
  506.     public function removeAbsenceLog(AbsenceLog $absenceLog): self
  507.     {
  508.         if ($this->absenceLogs->contains($absenceLog)) {
  509.             $this->absenceLogs->removeElement($absenceLog);
  510.             // set the owning side to null (unless already changed)
  511.             if ($absenceLog->getSubscription() === $this) {
  512.                 $absenceLog->setSubscription(null);
  513.             }
  514.         }
  515.         return $this;
  516.     }
  517.     /**
  518.      * @return Collection|SubscriptionLessonReport[]
  519.      */
  520.     public function getSubscriptionLessonReports(): Collection
  521.     {
  522.         return $this->subscriptionLessonReports;
  523.     }
  524.     public function addSubscriptionLessonReport(SubscriptionLessonReport $subscriptionLessonReport): self
  525.     {
  526.         if (!$this->subscriptionLessonReports->contains($subscriptionLessonReport)) {
  527.             $this->subscriptionLessonReports[] = $subscriptionLessonReport;
  528.             $subscriptionLessonReport->setSubscription($this);
  529.         }
  530.         return $this;
  531.     }
  532.     public function removeSubscriptionLessonReport(SubscriptionLessonReport $subscriptionLessonReport): self
  533.     {
  534.         if ($this->subscriptionLessonReports->contains($subscriptionLessonReport)) {
  535.             $this->subscriptionLessonReports->removeElement($subscriptionLessonReport);
  536.             // set the owning side to null (unless already changed)
  537.             if ($subscriptionLessonReport->getSubscription() === $this) {
  538.                 $subscriptionLessonReport->setSubscription(null);
  539.             }
  540.         }
  541.         return $this;
  542.     }
  543.     public function getCancellationDate(): ?\DateTimeInterface
  544.     {
  545.         return $this->cancellationDate;
  546.     }
  547.     public function setCancellationDate(?\DateTimeInterface $cancellationDate): self
  548.     {
  549.         $this->cancellationDate $cancellationDate;
  550.         return $this;
  551.     }
  552.     public function __toString()
  553.     {
  554.         return $this->getCustomerId();
  555.     }
  556.     public function getSubjectLevel(): ?SubjectLevel
  557.     {
  558.         return $this->subjectLevel;
  559.     }
  560.     public function setSubjectLevel(?SubjectLevel $subjectLevel): self
  561.     {
  562.         $this->subjectLevel $subjectLevel;
  563.         return $this;
  564.     }
  565.     public function getPaidAmount(): ?float
  566.     {
  567.         return $this->paidAmount;
  568.     }
  569.     public function setPaidAmount(float $paidAmount): self
  570.     {
  571.         $this->paidAmount round($paidAmount2);
  572.         return $this;
  573.     }
  574.     public function getTotalLostMinutes(): ?int
  575.     {
  576.         return $this->TotalLostMinutes;
  577.     }
  578.     public function setTotalLostMinutes(?int $TotalLostMinutes): self
  579.     {
  580.         $this->TotalLostMinutes $TotalLostMinutes;
  581.         return $this;
  582.     }
  583.     /**
  584.      * Quand des minutes de cours sont perdues, j'augmente le total avec les minutes perdues
  585.      * @param $lostMinutes
  586.      * @return mixed
  587.      */
  588.     public function incrementTotalListMinutes($lostMinutes)
  589.     {
  590.         $newTotal $this->TotalLostMinutes $lostMinutes;
  591.         return $newTotal;
  592.     }
  593.     /**
  594.      * Quand des minutes sont rattrapées, je les déduit de ce total
  595.      * @param $minutesCaughtUp
  596.      * @return mixed
  597.      */
  598.     public function decrementTotalListMinutes($minutesCaughtUp)
  599.     {
  600.         $newTotal $this->TotalLostMinutes $minutesCaughtUp;
  601.         return $newTotal;
  602.     }
  603.     /**
  604.      * @return Collection|Homework[]
  605.      */
  606.     public function getHomeworks(): Collection
  607.     {
  608.         return $this->homeworks;
  609.     }
  610.     public function addHomework(Homework $homework): self
  611.     {
  612.         if (!$this->homeworks->contains($homework)) {
  613.             $this->homeworks[] = $homework;
  614.             $homework->setRelatedToSubscription($this);
  615.         }
  616.         return $this;
  617.     }
  618.     public function removeHomework(Homework $homework): self
  619.     {
  620.         if ($this->homeworks->contains($homework)) {
  621.             $this->homeworks->removeElement($homework);
  622.             // set the owning side to null (unless already changed)
  623.             if ($homework->getRelatedToSubscription() === $this) {
  624.                 $homework->setRelatedToSubscription(null);
  625.             }
  626.         }
  627.         return $this;
  628.     }
  629.     public function getHaveRamadanCredit(): ?bool
  630.     {
  631.         return $this->haveRamadanCredit;
  632.     }
  633.     public function setHaveRamadanCredit(?bool $haveRamadanCredit): self
  634.     {
  635.         $this->haveRamadanCredit $haveRamadanCredit;
  636.         return $this;
  637.     }
  638.     public function getRamadanCreditAmount(): ?float
  639.     {
  640.         return $this->ramadanCreditAmount;
  641.     }
  642.     public function setRamadanCreditAmount(?float $ramadanCreditAmount): self
  643.     {
  644.         $this->ramadanCreditAmount round($ramadanCreditAmount2);
  645.         return $this;
  646.     }
  647.     /*
  648.     /**
  649.      * @Assert\Callback()
  650.      */
  651.     /*
  652.     public function validate(ExecutionContextInterface $context, $payload) {
  653.         if($this->getSubject()->getHasLevel() === true) {
  654.             if( $this->getSubjectLevel() === null || $this->getSubjectLevel()->getSubject()->getId() != $this->getSubject()->getId() ) {
  655.                 $context->buildViolation('form.subjectlevel.error')
  656.                         ->setTranslationDomain('subscription')
  657.                         ->atPath('subjectLevel')
  658.                         ->addViolation();
  659.             }
  660.         }
  661.     }*/
  662.     /**
  663.      * @return Collection|ActiveCampainSubscribeLostLog[]
  664.      */
  665.     public function getSubscribeLostLogs(): Collection
  666.     {
  667.         return $this->subscribeLostLogs;
  668.     }
  669.     public function addSubscribeLostLog(ActiveCampainSubscribeLostLog $subscribeLostLog): self
  670.     {
  671.         if (!$this->subscribeLostLogs->contains($subscribeLostLog)) {
  672.             $this->subscribeLostLogs[] = $subscribeLostLog;
  673.             $subscribeLostLog->setSubscription($this);
  674.         }
  675.         return $this;
  676.     }
  677.     public function removeSubscribeLostLog(ActiveCampainSubscribeLostLog $subscribeLostLog): self
  678.     {
  679.         if ($this->subscribeLostLogs->removeElement($subscribeLostLog)) {
  680.             // set the owning side to null (unless already changed)
  681.             if ($subscribeLostLog->getSubscription() === $this) {
  682.                 $subscribeLostLog->setSubscription(null);
  683.             }
  684.         }
  685.         return $this;
  686.     }
  687.     /**
  688.      * @return Collection|ActiveCampainUnsubscribeLog[]
  689.      */
  690.     public function getUnsubscribeLogs(): Collection
  691.     {
  692.         return $this->unsubscribeLogs;
  693.     }
  694.     public function addUnsubscribeLog(ActiveCampainUnsubscribeLog $unsubscribeLog): self
  695.     {
  696.         if (!$this->unsubscribeLogs->contains($unsubscribeLog)) {
  697.             $this->unsubscribeLogs[] = $unsubscribeLog;
  698.             $unsubscribeLog->setSubscription($this);
  699.         }
  700.         return $this;
  701.     }
  702.     public function removeUnsubscribeLog(ActiveCampainUnsubscribeLog $unsubscribeLog): self
  703.     {
  704.         if ($this->unsubscribeLogs->removeElement($unsubscribeLog)) {
  705.             // set the owning side to null (unless already changed)
  706.             if ($unsubscribeLog->getSubscription() === $this) {
  707.                 $unsubscribeLog->setSubscription(null);
  708.             }
  709.         }
  710.         return $this;
  711.     }
  712.     /**
  713.      * @return Collection|Exam[]
  714.      */
  715.     public function getExams(): Collection
  716.     {
  717.         return $this->exams;
  718.     }
  719.     public function addExam(Exam $exam): self
  720.     {
  721.         if (!$this->exams->contains($exam)) {
  722.             $this->exams[] = $exam;
  723.             $exam->setRelatedToSubscription($this);
  724.         }
  725.         return $this;
  726.     }
  727.     public function removeExam(Exam $exam): self
  728.     {
  729.         if ($this->exams->removeElement($exam)) {
  730.             // set the owning side to null (unless already changed)
  731.             if ($exam->getRelatedToSubscription() === $this) {
  732.                 $exam->setRelatedToSubscription(null);
  733.             }
  734.         }
  735.         return $this;
  736.     }
  737.     /**
  738.      * @return Collection|TrainingReport[]
  739.      */
  740.     public function getTrainingReports(): Collection
  741.     {
  742.         return $this->trainingReports;
  743.     }
  744.     public function addTrainingReport(TrainingReport $trainingReport): self
  745.     {
  746.         if (!$this->trainingReports->contains($trainingReport)) {
  747.             $this->trainingReports[] = $trainingReport;
  748.             $trainingReport->setRelatedToSubscription($this);
  749.         }
  750.         return $this;
  751.     }
  752.     public function removeTrainingReport(TrainingReport $trainingReport): self
  753.     {
  754.         if ($this->trainingReports->removeElement($trainingReport)) {
  755.             // set the owning side to null (unless already changed)
  756.             if ($trainingReport->getRelatedToSubscription() === $this) {
  757.                 $trainingReport->setRelatedToSubscription(null);
  758.             }
  759.         }
  760.         return $this;
  761.     }
  762. }