<?php
namespace App\Entity;
use App\Repository\CourseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CourseRepository::class)
*/
class Course
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\OneToOne(targetEntity=CourseDetail::class, mappedBy="course", cascade={"persist", "remove"}, fetch="EAGER")
*/
private $courseDetail;
/**
* @ORM\OneToOne(targetEntity=CoursePrice::class, mappedBy="course", cascade={"persist", "remove"}, fetch="EAGER")
*/
private $coursePrice;
/**
* @ORM\OneToMany(targetEntity=CourseToGroup::class, mappedBy="course", cascade={"persist", "remove"})
*/
private $courseToGroup;
/**
* @ORM\OneToMany(targetEntity=CourseSchedule::class, mappedBy="course")
*/
private $courseSchedules;
/**
* @ORM\OneToMany(targetEntity=Group::class, mappedBy="course")
*/
private $groups;
/**
* @ORM\OneToMany(targetEntity=PotentialClient::class, mappedBy="course")
*/
private $potentialClients;
/**
* @ORM\OneToMany(targetEntity=WaitingList::class, mappedBy="course")
*/
private $waitingLists;
/**
* @ORM\Column(type="string", length=255, unique=true)
*/
private $uuid;
public function __construct()
{
$this->courseSchedules = new ArrayCollection();
$this->groups = new ArrayCollection();
$this->potencialClients = new ArrayCollection();
$this->waitingLists = new ArrayCollection();
$this->courseToGroup = new ArrayCollection();
$this->potentialClients = 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 getCourseDetail(): ?CourseDetail
{
return $this->courseDetail;
}
public function setCourseDetail(CourseDetail $courseDetail): self
{
// set the owning side of the relation if necessary
if ($courseDetail->getCourse() !== $this) {
$courseDetail->setCourse($this);
}
$this->courseDetail = $courseDetail;
return $this;
}
public function getCourseToGroup()
{
return $this->courseToGroup;
}
public function setCourseToGroup(CourseToGroup $courseToGroup): self
{
// set the owning side of the relation if necessary
if ($courseToGroup->getCourse() !== $this) {
$courseToGroup->setCourse($this);
}
$this->courseToGroup = $courseToGroup;
return $this;
}
public function getCoursePrice(): ?CoursePrice
{
return $this->coursePrice;
}
public function setCoursePrice(CourseDetail $coursePrice): self
{
// set the owning side of the relation if necessary
if ($coursePrice->getCourse() !== $this) {
$coursePrice->setCourse($this);
}
$this->coursePrice = $coursePrice;
return $this;
}
/**
* @return Collection<int, CourseSchedule>
*/
public function getCourseSchedules(): Collection
{
return $this->courseSchedules;
}
public function addCourseSchedule(CourseSchedule $courseSchedule): self
{
if (!$this->courseSchedules->contains($courseSchedule)) {
$this->courseSchedules[] = $courseSchedule;
$courseSchedule->setCourse($this);
}
return $this;
}
public function removeCourseSchedule(CourseSchedule $courseSchedule): self
{
if ($this->courseSchedules->removeElement($courseSchedule)) {
// set the owning side to null (unless already changed)
if ($courseSchedule->getCourse() === $this) {
$courseSchedule->setCourse(null);
}
}
return $this;
}
/**
* @return Collection<int, Group>
*/
public function getGroups(): Collection
{
return $this->groups;
}
public function addGroup(Group $group): self
{
if (!$this->groups->contains($group)) {
$this->groups[] = $group;
$group->setCourse($this);
}
return $this;
}
public function removeGroup(Group $group): self
{
if ($this->groups->removeElement($group)) {
// set the owning side to null (unless already changed)
if ($group->getCourse() === $this) {
$group->setCourse(null);
}
}
return $this;
}
/**
* @return Collection<int, PotentialClient>
*/
public function getPotencialClients(): Collection
{
return $this->potencialClients;
}
public function addPotencialClient(PotentialClient $potencialClient): self
{
if (!$this->potencialClients->contains($potencialClient)) {
$this->potencialClients[] = $potencialClient;
$potencialClient->setCourse($this);
}
return $this;
}
public function removePotencialClient(PotentialClient $potencialClient): self
{
if ($this->potencialClients->removeElement($potencialClient)) {
// set the owning side to null (unless already changed)
if ($potencialClient->getCourse() === $this) {
$potencialClient->setCourse(null);
}
}
return $this;
}
/**
* @return Collection<int, WaitingList>
*/
public function getWaitingLists(): Collection
{
return $this->waitingLists;
}
public function addWaitingList(WaitingList $waitingList): self
{
if (!$this->waitingLists->contains($waitingList)) {
$this->waitingLists[] = $waitingList;
$waitingList->setCourse($this);
}
return $this;
}
public function removeWaitingList(WaitingList $waitingList): self
{
if ($this->waitingLists->removeElement($waitingList)) {
// set the owning side to null (unless already changed)
if ($waitingList->getCourse() === $this) {
$waitingList->setCourse(null);
}
}
return $this;
}
public function addCourseToGroup(CourseToGroup $courseToGroup): static
{
if (!$this->courseToGroup->contains($courseToGroup)) {
$this->courseToGroup->add($courseToGroup);
$courseToGroup->setCourse($this);
}
return $this;
}
public function removeCourseToGroup(CourseToGroup $courseToGroup): static
{
if ($this->courseToGroup->removeElement($courseToGroup)) {
// set the owning side to null (unless already changed)
if ($courseToGroup->getCourse() === $this) {
$courseToGroup->setCourse(null);
}
}
return $this;
}
/**
* @return Collection<int, PotentialClient>
*/
public function getPotentialClients(): Collection
{
return $this->potentialClients;
}
public function addPotentialClient(PotentialClient $potentialClient): static
{
if (!$this->potentialClients->contains($potentialClient)) {
$this->potentialClients->add($potentialClient);
$potentialClient->setCourse($this);
}
return $this;
}
public function removePotentialClient(PotentialClient $potentialClient): static
{
if ($this->potentialClients->removeElement($potentialClient)) {
// set the owning side to null (unless already changed)
if ($potentialClient->getCourse() === $this) {
$potentialClient->setCourse(null);
}
}
return $this;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
}