src/Entity/Course.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CourseRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CourseRepository::class)
  9.  */
  10. class Course
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\OneToOne(targetEntity=CourseDetail::class, mappedBy="course", cascade={"persist", "remove"}, fetch="EAGER")
  24.      */
  25.     private $courseDetail;
  26.     /**
  27.      * @ORM\OneToOne(targetEntity=CoursePrice::class, mappedBy="course", cascade={"persist", "remove"}, fetch="EAGER")
  28.      */
  29.     private $coursePrice;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=CourseToGroup::class, mappedBy="course", cascade={"persist", "remove"})
  32.      */
  33.     private $courseToGroup;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=CourseSchedule::class, mappedBy="course")
  36.      */
  37.     private $courseSchedules;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=Group::class, mappedBy="course")
  40.      */
  41.     private $groups;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity=PotentialClient::class, mappedBy="course")
  44.      */
  45.     private $potentialClients;
  46.     /**
  47.      * @ORM\OneToMany(targetEntity=WaitingList::class, mappedBy="course")
  48.      */
  49.     private $waitingLists;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, unique=true)
  52.      */
  53.     private $uuid;
  54.     public function __construct()
  55.     {
  56.         $this->courseSchedules = new ArrayCollection();
  57.         $this->groups = new ArrayCollection();
  58.         $this->potencialClients = new ArrayCollection();
  59.         $this->waitingLists = new ArrayCollection();
  60.         $this->courseToGroup = new ArrayCollection();
  61.         $this->potentialClients = new ArrayCollection();
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getName(): ?string
  68.     {
  69.         return $this->name;
  70.     }
  71.     public function setName(string $name): self
  72.     {
  73.         $this->name $name;
  74.         return $this;
  75.     }
  76.     public function getCourseDetail(): ?CourseDetail
  77.     {
  78.         return $this->courseDetail;
  79.     }
  80.     public function setCourseDetail(CourseDetail $courseDetail): self
  81.     {
  82.         // set the owning side of the relation if necessary
  83.         if ($courseDetail->getCourse() !== $this) {
  84.             $courseDetail->setCourse($this);
  85.         }
  86.         $this->courseDetail $courseDetail;
  87.         return $this;
  88.     }
  89.     public function getCourseToGroup()
  90.     {
  91.         return $this->courseToGroup;
  92.     }
  93.     public function setCourseToGroup(CourseToGroup $courseToGroup): self
  94.     {
  95.         // set the owning side of the relation if necessary
  96.         if ($courseToGroup->getCourse() !== $this) {
  97.             $courseToGroup->setCourse($this);
  98.         }
  99.         $this->courseToGroup $courseToGroup;
  100.         return $this;
  101.     }
  102.     public function getCoursePrice(): ?CoursePrice
  103.     {
  104.         return $this->coursePrice;
  105.     }
  106.     public function setCoursePrice(CourseDetail $coursePrice): self
  107.     {
  108.         // set the owning side of the relation if necessary
  109.         if ($coursePrice->getCourse() !== $this) {
  110.             $coursePrice->setCourse($this);
  111.         }
  112.         $this->coursePrice $coursePrice;
  113.         return $this;
  114.     }
  115.     /**
  116.      * @return Collection<int, CourseSchedule>
  117.      */
  118.     public function getCourseSchedules(): Collection
  119.     {
  120.         return $this->courseSchedules;
  121.     }
  122.     public function addCourseSchedule(CourseSchedule $courseSchedule): self
  123.     {
  124.         if (!$this->courseSchedules->contains($courseSchedule)) {
  125.             $this->courseSchedules[] = $courseSchedule;
  126.             $courseSchedule->setCourse($this);
  127.         }
  128.         return $this;
  129.     }
  130.     public function removeCourseSchedule(CourseSchedule $courseSchedule): self
  131.     {
  132.         if ($this->courseSchedules->removeElement($courseSchedule)) {
  133.             // set the owning side to null (unless already changed)
  134.             if ($courseSchedule->getCourse() === $this) {
  135.                 $courseSchedule->setCourse(null);
  136.             }
  137.         }
  138.         return $this;
  139.     }
  140.     /**
  141.      * @return Collection<int, Group>
  142.      */
  143.     public function getGroups(): Collection
  144.     {
  145.         return $this->groups;
  146.     }
  147.     public function addGroup(Group $group): self
  148.     {
  149.         if (!$this->groups->contains($group)) {
  150.             $this->groups[] = $group;
  151.             $group->setCourse($this);
  152.         }
  153.         return $this;
  154.     }
  155.     public function removeGroup(Group $group): self
  156.     {
  157.         if ($this->groups->removeElement($group)) {
  158.             // set the owning side to null (unless already changed)
  159.             if ($group->getCourse() === $this) {
  160.                 $group->setCourse(null);
  161.             }
  162.         }
  163.         return $this;
  164.     }
  165.     /**
  166.      * @return Collection<int, PotentialClient>
  167.      */
  168.     public function getPotencialClients(): Collection
  169.     {
  170.         return $this->potencialClients;
  171.     }
  172.     public function addPotencialClient(PotentialClient $potencialClient): self
  173.     {
  174.         if (!$this->potencialClients->contains($potencialClient)) {
  175.             $this->potencialClients[] = $potencialClient;
  176.             $potencialClient->setCourse($this);
  177.         }
  178.         return $this;
  179.     }
  180.     public function removePotencialClient(PotentialClient $potencialClient): self
  181.     {
  182.         if ($this->potencialClients->removeElement($potencialClient)) {
  183.             // set the owning side to null (unless already changed)
  184.             if ($potencialClient->getCourse() === $this) {
  185.                 $potencialClient->setCourse(null);
  186.             }
  187.         }
  188.         return $this;
  189.     }
  190.     /**
  191.      * @return Collection<int, WaitingList>
  192.      */
  193.     public function getWaitingLists(): Collection
  194.     {
  195.         return $this->waitingLists;
  196.     }
  197.     public function addWaitingList(WaitingList $waitingList): self
  198.     {
  199.         if (!$this->waitingLists->contains($waitingList)) {
  200.             $this->waitingLists[] = $waitingList;
  201.             $waitingList->setCourse($this);
  202.         }
  203.         return $this;
  204.     }
  205.     public function removeWaitingList(WaitingList $waitingList): self
  206.     {
  207.         if ($this->waitingLists->removeElement($waitingList)) {
  208.             // set the owning side to null (unless already changed)
  209.             if ($waitingList->getCourse() === $this) {
  210.                 $waitingList->setCourse(null);
  211.             }
  212.         }
  213.         return $this;
  214.     }
  215.     public function addCourseToGroup(CourseToGroup $courseToGroup): static
  216.     {
  217.         if (!$this->courseToGroup->contains($courseToGroup)) {
  218.             $this->courseToGroup->add($courseToGroup);
  219.             $courseToGroup->setCourse($this);
  220.         }
  221.         return $this;
  222.     }
  223.     public function removeCourseToGroup(CourseToGroup $courseToGroup): static
  224.     {
  225.         if ($this->courseToGroup->removeElement($courseToGroup)) {
  226.             // set the owning side to null (unless already changed)
  227.             if ($courseToGroup->getCourse() === $this) {
  228.                 $courseToGroup->setCourse(null);
  229.             }
  230.         }
  231.         return $this;
  232.     }
  233.     /**
  234.      * @return Collection<int, PotentialClient>
  235.      */
  236.     public function getPotentialClients(): Collection
  237.     {
  238.         return $this->potentialClients;
  239.     }
  240.     public function addPotentialClient(PotentialClient $potentialClient): static
  241.     {
  242.         if (!$this->potentialClients->contains($potentialClient)) {
  243.             $this->potentialClients->add($potentialClient);
  244.             $potentialClient->setCourse($this);
  245.         }
  246.         return $this;
  247.     }
  248.     public function removePotentialClient(PotentialClient $potentialClient): static
  249.     {
  250.         if ($this->potentialClients->removeElement($potentialClient)) {
  251.             // set the owning side to null (unless already changed)
  252.             if ($potentialClient->getCourse() === $this) {
  253.                 $potentialClient->setCourse(null);
  254.             }
  255.         }
  256.         return $this;
  257.     }
  258.     public function getUuid(): ?string
  259.     {
  260.         return $this->uuid;
  261.     }
  262.     public function setUuid(string $uuid): self
  263.     {
  264.         $this->uuid $uuid;
  265.         return $this;
  266.     }
  267. }