<?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\SubjectLevelRepository")
*/
class SubjectLevel
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=150)
*/
private $name;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $level;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Subject", inversedBy="subjectLevels")
*/
private $subject;
/**
* @ORM\Column(type="smallint")
*/
private $order;
/**
* @ORM\Column(type="string", length=150)
*/
private $nameEn;
/**
* @ORM\OneToMany(targetEntity="App\Entity\ProgramUrl", mappedBy="subjectLevel")
*/
private $programUrls;
/**
* @ORM\OneToMany(targetEntity="App\Entity\SubscriptionOrder", mappedBy="subjectLevel")
*/
private $subscriptionOrder;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Session", mappedBy="level")
*/
private $groupSessions;
/**
* @ORM\OneToMany(targetEntity=LevelTest::class, mappedBy="subjectLevel")
*/
private $levelTests;
/**
* @ORM\OneToMany(targetEntity=UserPlacementTest::class, mappedBy="testResult")
*/
private $userPlacementTests;
/**
* @ORM\OneToMany(targetEntity=TrainingReport::class, mappedBy="level")
*/
private $trainingReports;
/**
* @ORM\OneToMany(targetEntity=TeacherLeveltest::class, mappedBy="maxLevel")
*/
private $teacherLeveltests;
/**
* @ORM\OneToMany(targetEntity=LevelTestAdvice::class, mappedBy="level")
*/
private $levelTestAdvice;
/**
* @ORM\OneToMany(targetEntity=TeacherSubject::class, mappedBy="fromLevel")
*/
private $teacherSubjects;
/**
* @ORM\Column(type="boolean")
*/
private $isSession = false;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $sessionPrice;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $sessionIsPublic;
/**
* @ORM\Column(type="smallint", length=3)
*/
private $sessionNbCourse;
/**
* @ORM\Column(type="smallint", length=1)
*/
private $sessionNbCourseMinByWeek;
/**
* @ORM\Column(type="smallint", length=3)
*/
private $sessionDuration;
/**
* @ORM\Column(type="smallint", length=3)
*/
private $sessionSeats;
public function __construct()
{
$this->programUrls = new ArrayCollection();
$this->subscriptionOrder = new ArrayCollection();
$this->groupSessions = new ArrayCollection();
$this->levelTests = new ArrayCollection();
$this->userPlacementTests = new ArrayCollection();
$this->trainingReports = new ArrayCollection();
$this->teacherLeveltests = new ArrayCollection();
$this->levelTestAdvice = new ArrayCollection();
$this->teacherSubjects = 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 getLevel(): ?string
{
return $this->level;
}
public function setLevel(?string $level): self
{
$this->level = $level;
return $this;
}
public function getSubject(): ?Subject
{
return $this->subject;
}
public function setSubject(?Subject $subject): self
{
$this->subject = $subject;
return $this;
}
public function getNameEn(): ?string
{
return $this->nameEn;
}
public function setNameEn(string $nameEn): self
{
$this->nameEn = $nameEn;
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->setSubjectLevel($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->getSubjectLevel() === $this) {
$programUrl->setSubjectLevel(null);
}
}
return $this;
}
/**
* @return Collection|SubscriptionOrder[]
*/
public function getSubscriptionOrder(): Collection
{
return $this->subscriptionOrder;
}
public function addSubscriptionOrder(SubscriptionOrder $subscriptionOrder): self
{
if ( ! $this->subscriptionOrder->contains($subscriptionOrder)) {
$this->subscriptionOrder[] = $subscriptionOrder;
$subscriptionOrder->setSubjectLevel($this);
}
return $this;
}
public function removeSubscriptionOrder(SubscriptionOrder $subscriptionOrder): self
{
if ($this->subscriptionOrder->contains($subscriptionOrder)) {
$this->subscriptionOrder->removeElement($subscriptionOrder);
// set the owning side to null (unless already changed)
if ($subscriptionOrder->getSubjectLevel() === $this) {
$subscriptionOrder->setSubjectLevel(null);
}
}
return $this;
}
/**
* @return Collection|Session[]
*/
public function getGroupSessions(): Collection
{
return $this->groupSessions;
}
public function addGroupSession(Session $groupSession): self
{
if ( ! $this->groupSessions->contains($groupSession)) {
$this->groupSessions[] = $groupSession;
$groupSession->setLevel($this);
}
return $this;
}
public function removeGroupSession(Session $groupSession): self
{
if ($this->groupSessions->contains($groupSession)) {
$this->groupSessions->removeElement($groupSession);
// set the owning side to null (unless already changed)
if ($groupSession->getLevel() === $this) {
$groupSession->setLevel(null);
}
}
return $this;
}
public function __toString()
{
return $this->getNameEn();
}
/**
* @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->setSubjectLevel($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->getSubjectLevel() === $this) {
$levelTest->setSubjectLevel(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->setTestResult($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->getTestResult() === $this) {
$userPlacementTest->setTestResult(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->setLevel($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->getLevel() === $this) {
$trainingReport->setLevel(null);
}
}
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->setMaxLevel($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->getMaxLevel() === $this) {
$teacherLeveltest->setMaxLevel(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->setLevel($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->getLevel() === $this) {
$levelTestAdvice->setLevel(null);
}
}
return $this;
}
/**
* @return Collection<int, TeacherSubject>
*/
public function getTeacherSubjects(): Collection
{
return $this->teacherSubjects;
}
public function addTeacherSubject(TeacherSubject $teacherSubject): self
{
if ( ! $this->teacherSubjects->contains($teacherSubject)) {
$this->teacherSubjects[] = $teacherSubject;
$teacherSubject->setFromLevel($this);
}
return $this;
}
public function removeTeacherSubject(TeacherSubject $teacherSubject): self
{
if ($this->teacherSubjects->removeElement($teacherSubject)) {
// set the owning side to null (unless already changed)
if ($teacherSubject->getFromLevel() === $this) {
$teacherSubject->setFromLevel(null);
}
}
return $this;
}
public function isSession(): bool
{
return $this->isSession;
}
public function setIsSession(bool $isSession): void
{
$this->isSession = $isSession;
}
/**
* @return mixed
*/
public function getSessionPrice()
{
return $this->sessionPrice;
}
/**
* @param mixed $sessionPrice
*/
public function setSessionPrice($sessionPrice): void
{
$this->sessionPrice = $sessionPrice;
}
/**
* @return mixed
*/
public function getSessionIsPublic()
{
return $this->sessionIsPublic;
}
/**
* @param mixed $sessionIsPublic
*/
public function setSessionIsPublic($sessionIsPublic): void
{
$this->sessionIsPublic = $sessionIsPublic;
}
/**
* @return mixed
*/
public function getSessionNbCourse()
{
return $this->sessionNbCourse;
}
/**
* @param mixed $sessionNbCourse
*/
public function setSessionNbCourse($sessionNbCourse): void
{
$this->sessionNbCourse = $sessionNbCourse;
}
/**
* @return mixed
*/
public function getSessionDuration()
{
return $this->sessionDuration;
}
/**
* @param mixed $sessionDuration
*/
public function setSessionDuration($sessionDuration): void
{
$this->sessionDuration = $sessionDuration;
}
/**
* @return mixed
*/
public function getSessionSeats()
{
return $this->sessionSeats;
}
/**
* @param mixed $sessionSeats
*/
public function setSessionSeats($sessionSeats): void
{
$this->sessionSeats = $sessionSeats;
}
public function getSessionNbCourseMinByWeek(): int
{
return $this->sessionNbCourseMinByWeek;
}
public function setSessionNbCourseMinByWeek($sessionNbCourseMinByWeek)
{
$this->sessionNbCourseMinByWeek = $sessionNbCourseMinByWeek;
return $this;
}
public function getOrder()
{
return $this->order;
}
public function setOrder($order)
{
$this->order = $order;
return $this;
}
}