<?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\SubjectRepository")
*/
class Subject
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100)
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
*/
private $description;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="subjects")
* @ORM\JoinColumn(nullable=false)
*/
private $category;
/**
* @ORM\OneToMany(targetEntity="App\Entity\SubscriptionOrder", mappedBy="subject")
*/
private $subscriptionOrders;
/**
* @ORM\Column(type="string", length=255)
*/
private $nameEn;
/**
* @ORM\Column(type="string", length=255)
*/
private $descriptionEn;
/**
* @ORM\OneToMany(targetEntity="App\Entity\SubjectLevel", mappedBy="subject")
*/
private $subjectLevels;
/**
* @ORM\OneToMany(targetEntity="App\Entity\ProgramUrl", mappedBy="subject")
*/
private $programUrls;
/**
* @ORM\OneToMany(targetEntity="App\Entity\TeacherSubject", mappedBy="subject")
*/
private $teacherSubjects;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isFree;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $hasLevel;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $price;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isPublic;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $tagName;
/**
* @ORM\OneToMany(targetEntity=LevelTest::class, mappedBy="subject")
*/
private $levelTests;
/**
* @ORM\OneToMany(targetEntity=SessionRegistrationDate::class, mappedBy="subject")
*/
private $sessionRegistrationDates;
/**
* @ORM\OneToMany(targetEntity=StripePlanForGroup::class, mappedBy="subject")
*/
private $stripePlanForGroups;
/**
* @ORM\OneToMany(targetEntity=UserPlacementTest::class, mappedBy="subject")
*/
private $userPlacementTests;
/**
* @ORM\OneToMany(targetEntity=Exam::class, mappedBy="program", orphanRemoval=true)
*/
private $exams;
/**
* @ORM\OneToMany(targetEntity=TrainingReport::class, mappedBy="program")
*/
private $trainingReports;
/**
* @ORM\OneToMany(targetEntity=Discount::class, mappedBy="subject")
*/
private $discounts;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isDefault;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $hasMidExam;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $hasEndExam;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $hasOralExam;
/**
* @ORM\OneToMany(targetEntity=TeacherLeveltest::class, mappedBy="subject")
*/
private $teacherLeveltests;
/**
* @ORM\OneToMany(targetEntity=LevelTestAdvice::class, mappedBy="subject")
*/
private $levelTestAdvice;
public function __construct()
{
$this->teachers = new ArrayCollection();
$this->subscriptionOrders = new ArrayCollection();
$this->subjectLevels = new ArrayCollection();
$this->programUrls = new ArrayCollection();
$this->teacherSubjects = new ArrayCollection();
$this->levelTests = new ArrayCollection();
$this->sessionRegistrationDates = new ArrayCollection();
$this->stripePlanForGroups = new ArrayCollection();
$this->userPlacementTests = new ArrayCollection();
$this->exams = new ArrayCollection();
$this->trainingReports = new ArrayCollection();
$this->discounts = new ArrayCollection();
$this->teacherLeveltests = new ArrayCollection();
$this->levelTestAdvice = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getCategory(): ?Category
{
return $this->category;
}
public function setCategory(?Category $category): self
{
$this->category = $category;
return $this;
}
public function __toString()
{
return $this->getName();
}
/**
* @return Collection|SubscriptionOrder[]
*/
public function getSubscriptionOrders(): Collection
{
return $this->subscriptionOrders;
}
public function addSubscriptionOrder(SubscriptionOrder $subscriptionOrder): self
{
if (!$this->subscriptionOrders->contains($subscriptionOrder)) {
$this->subscriptionOrders[] = $subscriptionOrder;
$subscriptionOrder->setSubject($this);
}
return $this;
}
public function removeSubscriptionOrder(SubscriptionOrder $subscriptionOrder): self
{
if ($this->subscriptionOrders->contains($subscriptionOrder)) {
$this->subscriptionOrders->removeElement($subscriptionOrder);
// set the owning side to null (unless already changed)
if ($subscriptionOrder->getSubject() === $this) {
$subscriptionOrder->setSubject(null);
}
}
return $this;
}
public function getNameEn(): ?string
{
return $this->nameEn;
}
public function setNameEn(?string $nameEn): self
{
$this->nameEn = $nameEn;
return $this;
}
public function getDescriptionEn(): ?string
{
return $this->descriptionEn;
}
public function setDescriptionEn(?string $descriptionEn): self
{
$this->descriptionEn = $descriptionEn;
return $this;
}
/**
* @return Collection|SubjectLevel[]
*/
public function getSubjectLevels(): Collection
{
return $this->subjectLevels;
}
public function addSubjectLevel(SubjectLevel $subjectLevel): self
{
if (!$this->subjectLevels->contains($subjectLevel)) {
$this->subjectLevels[] = $subjectLevel;
$subjectLevel->setSubject($this);
}
return $this;
}
public function removeSubjectLevel(SubjectLevel $subjectLevel): self
{
if ($this->subjectLevels->contains($subjectLevel)) {
$this->subjectLevels->removeElement($subjectLevel);
// set the owning side to null (unless already changed)
if ($subjectLevel->getSubject() === $this) {
$subjectLevel->setSubject(null);
}
}
return $this;
}
/**
* @return Collection|ProgramUrl[]
*/
public function getProgramUrls(): Collection
{
return $this->programUrls;
}
public function addProgramUrl(ProgramUrl $programUrl): self
{
if (!$this->programUrls->contains($programUrl)) {
$this->programUrls[] = $programUrl;
$programUrl->setSubject($this);
}
return $this;
}
public function removeProgramUrl(ProgramUrl $programUrl): self
{
if ($this->programUrls->contains($programUrl)) {
$this->programUrls->removeElement($programUrl);
// set the owning side to null (unless already changed)
if ($programUrl->getSubject() === $this) {
$programUrl->setSubject(null);
}
}
return $this;
}
/**
* @return Collection|TeacherSubject[]
*/
public function getTeacherSubjects(): Collection
{
return $this->teacherSubjects;
}
public function addTeacherSubject(TeacherSubject $teacherSubject): self
{
if (!$this->teacherSubjects->contains($teacherSubject)) {
$this->teacherSubjects[] = $teacherSubject;
$teacherSubject->setSubject($this);
}
return $this;
}
public function removeTeacherSubject(TeacherSubject $teacherSubject): self
{
if ($this->teacherSubjects->contains($teacherSubject)) {
$this->teacherSubjects->removeElement($teacherSubject);
// set the owning side to null (unless already changed)
if ($teacherSubject->getSubject() === $this) {
$teacherSubject->setSubject(null);
}
}
return $this;
}
public function getIsFree(): ?bool
{
return $this->isFree;
}
public function setIsFree(?bool $isFree): self
{
$this->isFree = $isFree;
return $this;
}
public function getHasLevel(): ?bool
{
return $this->hasLevel;
}
public function setHasLevel(?bool $hasLevel): self
{
$this->hasLevel = $hasLevel;
return $this;
}
public function getPrice(): ?int
{
return $this->price;
}
public function setPrice(?int $price): self
{
$this->price = $price;
return $this;
}
public function getIsPublic(): ?bool
{
return $this->isPublic;
}
public function setIsPublic(?bool $isPublic): self
{
$this->isPublic = $isPublic;
return $this;
}
public function getTagName(): ?string
{
return $this->tagName;
}
public function setTagName(?string $tagName): self
{
$this->tagName = $tagName;
return $this;
}
/**
* @return Collection|LevelTest[]
*/
public function getLevelTests(): Collection
{
return $this->levelTests;
}
public function addLevelTest(LevelTest $levelTest): self
{
if (!$this->levelTests->contains($levelTest)) {
$this->levelTests[] = $levelTest;
$levelTest->setSubject($this);
}
return $this;
}
public function removeLevelTest(LevelTest $levelTest): self
{
if ($this->levelTests->removeElement($levelTest)) {
// set the owning side to null (unless already changed)
if ($levelTest->getSubject() === $this) {
$levelTest->setSubject(null);
}
}
return $this;
}
/**
* @return Collection|SessionRegistrationDate[]
*/
public function getSessionRegistrationDates(): Collection
{
return $this->sessionRegistrationDates;
}
public function addSessionRegistrationDate(SessionRegistrationDate $sessionRegistrationDate): self
{
if (!$this->sessionRegistrationDates->contains($sessionRegistrationDate)) {
$this->sessionRegistrationDates[] = $sessionRegistrationDate;
$sessionRegistrationDate->setSubject($this);
}
return $this;
}
public function removeSessionRegistrationDate(SessionRegistrationDate $sessionRegistrationDate): self
{
if ($this->sessionRegistrationDates->removeElement($sessionRegistrationDate)) {
// set the owning side to null (unless already changed)
if ($sessionRegistrationDate->getSubject() === $this) {
$sessionRegistrationDate->setSubject(null);
}
}
return $this;
}
/**
* @return Collection|StripePlanForGroup[]
*/
public function getStripePlanForGroups(): Collection
{
return $this->stripePlanForGroups;
}
public function addStripePlanForGroup(StripePlanForGroup $stripePlanForGroup): self
{
if (!$this->stripePlanForGroups->contains($stripePlanForGroup)) {
$this->stripePlanForGroups[] = $stripePlanForGroup;
$stripePlanForGroup->setSubject($this);
}
return $this;
}
public function removeStripePlanForGroup(StripePlanForGroup $stripePlanForGroup): self
{
if ($this->stripePlanForGroups->removeElement($stripePlanForGroup)) {
// set the owning side to null (unless already changed)
if ($stripePlanForGroup->getSubject() === $this) {
$stripePlanForGroup->setSubject(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->setSubject($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->getSubject() === $this) {
$userPlacementTest->setSubject(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->setProgram($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->getProgram() === $this) {
$exam->setProgram(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->setProgram($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->getProgram() === $this) {
$trainingReport->setProgram(null);
}
}
return $this;
}
/**
* @return Collection|Discount[]
*/
public function getDiscounts(): Collection
{
return $this->discounts;
}
public function addDiscount(Discount $discount): self
{
if (!$this->discounts->contains($discount)) {
$this->discounts[] = $discount;
$discount->setSubject($this);
}
return $this;
}
public function removeDiscount(Discount $discount): self
{
if ($this->discounts->removeElement($discount)) {
// set the owning side to null (unless already changed)
if ($discount->getSubject() === $this) {
$discount->setSubject(null);
}
}
return $this;
}
public function getIsDefault(): ?bool
{
return $this->isDefault;
}
public function setIsDefault(?bool $isDefault): self
{
$this->isDefault = $isDefault;
return $this;
}
public function getHasMidExam(): ?bool
{
return $this->hasMidExam;
}
public function setHasMidExam(?bool $hasMidExam): self
{
$this->hasMidExam = $hasMidExam;
return $this;
}
public function getHasEndExam(): ?bool
{
return $this->hasEndExam;
}
public function setHasEndExam(?bool $hasEndExam): self
{
$this->hasEndExam = $hasEndExam;
return $this;
}
public function getHasOralExam(): ?bool
{
return $this->hasOralExam;
}
public function setHasOralExam(?bool $hasOralExam): self
{
$this->hasOralExam = $hasOralExam;
return $this;
}
/**
* @return Collection<int, TeacherLeveltest>
*/
public function getTeacherLeveltests(): Collection
{
return $this->teacherLeveltests;
}
public function addTeacherLeveltest(TeacherLeveltest $teacherLeveltest): self
{
if (!$this->teacherLeveltests->contains($teacherLeveltest)) {
$this->teacherLeveltests[] = $teacherLeveltest;
$teacherLeveltest->setSubject($this);
}
return $this;
}
public function removeTeacherLeveltest(TeacherLeveltest $teacherLeveltest): self
{
if ($this->teacherLeveltests->removeElement($teacherLeveltest)) {
// set the owning side to null (unless already changed)
if ($teacherLeveltest->getSubject() === $this) {
$teacherLeveltest->setSubject(null);
}
}
return $this;
}
/**
* @return Collection<int, LevelTestAdvice>
*/
public function getLevelTestAdvice(): Collection
{
return $this->levelTestAdvice;
}
public function addLevelTestAdvice(LevelTestAdvice $levelTestAdvice): self
{
if (!$this->levelTestAdvice->contains($levelTestAdvice)) {
$this->levelTestAdvice[] = $levelTestAdvice;
$levelTestAdvice->setSubject($this);
}
return $this;
}
public function removeLevelTestAdvice(LevelTestAdvice $levelTestAdvice): self
{
if ($this->levelTestAdvice->removeElement($levelTestAdvice)) {
// set the owning side to null (unless already changed)
if ($levelTestAdvice->getSubject() === $this) {
$levelTestAdvice->setSubject(null);
}
}
return $this;
}
}