<?php
namespace App\Entity;
use App\Repository\GroupRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=GroupRepository::class)
* @ORM\Table(name="`group`")
*/
class Group
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Course::class, inversedBy="groups", fetch="EAGER")
* @ORM\JoinColumn(nullable=false)
*/
private $course;
/**
* @ORM\Column(type="string", length=255)
*/
private $date_start;
/**
* @ORM\OneToMany(targetEntity=Lesson::class, mappedBy="group_id")
*/
private $lessons;
/**
* @ORM\OneToMany(targetEntity=StudentsToGroup::class, mappedBy="class")
*/
private $studentsToGroups;
/**
* @ORM\OneToOne(targetEntity=GroupToTeacher::class, mappedBy="group_id", cascade={"persist", "remove"})
*/
private $groupToTeacher;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $day;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $hour;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $project_url;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $zoom_url;
/**
* @ORM\Column(type="integer")
*/
private $status;
/**
* @ORM\OneToMany(targetEntity=PotentialClient::class, mappedBy="groups")
*/
private $potentialClients;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $type;
/**
* @ORM\OneToOne(targetEntity=PaymentToGroup::class, mappedBy="course_group", cascade={"persist", "remove"})
*/
private $paymentToGroup;
/**
* @ORM\ManyToOne(targetEntity=School::class, inversedBy="groups", fetch="EAGER")
* @ORM\JoinColumn(nullable=true)
*/
private $school;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $deleted = false;
/**
* @ORM\Column(type="string", length=255, unique=true)
*/
private $uuid;
public function __construct()
{
$this->lessons = new ArrayCollection();
$this->studentsToGroups = new ArrayCollection();
$this->potencialClients = new ArrayCollection();
$this->potentialClients = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCourse(): ?course
{
return $this->course;
}
public function setCourse(?course $course): self
{
$this->course = $course;
return $this;
}
public function getDateStart(): ?string
{
return $this->date_start;
}
public function setDateStart(string $date_start): self
{
$this->date_start = $date_start;
return $this;
}
/**
* @return Collection<int, Lesson>
*/
public function getLessons(): Collection
{
return $this->lessons;
}
public function addLesson(Lesson $lesson): self
{
if (!$this->lessons->contains($lesson)) {
$this->lessons[] = $lesson;
$lesson->setGroupId($this);
}
return $this;
}
public function removeLesson(Lesson $lesson): self
{
if ($this->lessons->removeElement($lesson)) {
// set the owning side to null (unless already changed)
if ($lesson->getGroupId() === $this) {
$lesson->setGroupId(null);
}
}
return $this;
}
/**
* @return Collection<int, StudentsToGroup>
*/
public function getStudentsToGroups(): Collection
{
return $this->studentsToGroups;
}
public function addStudentsToGroup(StudentsToGroup $studentsToGroup): self
{
if (!$this->studentsToGroups->contains($studentsToGroup)) {
$this->studentsToGroups[] = $studentsToGroup;
$studentsToGroup->setClass($this);
}
return $this;
}
public function removeStudentsToGroup(StudentsToGroup $studentsToGroup): self
{
if ($this->studentsToGroups->removeElement($studentsToGroup)) {
// set the owning side to null (unless already changed)
if ($studentsToGroup->getClass() === $this) {
$studentsToGroup->setClass(null);
}
}
return $this;
}
public function getGroupToTeacher(): ?GroupToTeacher
{
return $this->groupToTeacher;
}
public function setGroupToTeacher(?GroupToTeacher $groupToTeacher): self
{
// unset the owning side of the relation if necessary
if ($groupToTeacher === null && $this->groupToTeacher !== null) {
$this->groupToTeacher->setGroupId(null);
}
// set the owning side of the relation if necessary
if ($groupToTeacher !== null && $groupToTeacher->getGroupId() !== $this) {
$groupToTeacher->setGroupId($this);
}
$this->groupToTeacher = $groupToTeacher;
return $this;
}
public function getDay(): ?string
{
return $this->day;
}
public function setDay(?string $day): self
{
$this->day = $day;
return $this;
}
public function getHour(): ?string
{
return $this->hour;
}
public function setHour(?string $hour): self
{
$this->hour = $hour;
return $this;
}
public function getProjectUrl(): ?string
{
return $this->project_url;
}
public function setProjectUrl(?string $project_url): self
{
$this->project_url = $project_url;
return $this;
}
public function getZoomUrl(): ?string
{
return $this->zoom_url;
}
public function setZoomUrl(?string $zoom_url): self
{
$this->zoom_url = $zoom_url;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
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->setGroups($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->getGroups() === $this) {
$potencialClient->setGroups(null);
}
}
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getPaymentToGroup(): ?PaymentToGroup
{
return $this->paymentToGroup;
}
public function setPaymentToGroup(?PaymentToGroup $paymentToGroup): self
{
// unset the owning side of the relation if necessary
if ($paymentToGroup === null && $this->paymentToGroup !== null) {
$this->paymentToGroup->setCourseGroup(null);
}
// set the owning side of the relation if necessary
if ($paymentToGroup !== null && $paymentToGroup->getCourseGroup() !== $this) {
$paymentToGroup->setCourseGroup($this);
}
$this->paymentToGroup = $paymentToGroup;
return $this;
}
public function getSchool(): ?School
{
return $this->school;
}
public function setSchool(?School $school): self
{
$this->school = $school;
return $this;
}
public function __toString()
{
return $this->getId();
}
/**
* @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->setGroups($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->getGroups() === $this) {
$potentialClient->setGroups(null);
}
}
return $this;
}
public function isDeleted(): bool
{
return $this->deleted;
}
public function setDeleted(bool $deleted): self
{
$this->deleted = $deleted;
return $this;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
}