src/Entity/Group.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\GroupRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=GroupRepository::class)
  9.  * @ORM\Table(name="`group`")
  10.  */
  11. class Group
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=Course::class, inversedBy="groups", fetch="EAGER")
  21.      * @ORM\JoinColumn(nullable=false)
  22.      */
  23.     private $course;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $date_start;
  28.     /**
  29.      * @ORM\OneToMany(targetEntity=Lesson::class, mappedBy="group_id")
  30.      */
  31.     private $lessons;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity=StudentsToGroup::class, mappedBy="class")
  34.      */
  35.     private $studentsToGroups;
  36.     /**
  37.      * @ORM\OneToOne(targetEntity=GroupToTeacher::class, mappedBy="group_id", cascade={"persist", "remove"})
  38.      */
  39.     private $groupToTeacher;
  40.     /**
  41.      * @ORM\Column(type="string", length=255, nullable=true)
  42.      */
  43.     private $day;
  44.     /**
  45.      * @ORM\Column(type="string", length=255, nullable=true)
  46.      */
  47.     private $hour;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      */
  51.     private $project_url;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=true)
  54.      */
  55.     private $zoom_url;
  56.     /**
  57.      * @ORM\Column(type="integer")
  58.      */
  59.     private $status;
  60.     /**
  61.      * @ORM\OneToMany(targetEntity=PotentialClient::class, mappedBy="groups")
  62.      */
  63.     private $potentialClients;
  64.     /**
  65.      * @ORM\Column(type="string", length=255, nullable=true)
  66.      */
  67.     private $type;
  68.     /**
  69.      * @ORM\OneToOne(targetEntity=PaymentToGroup::class, mappedBy="course_group", cascade={"persist", "remove"})
  70.      */
  71.     private $paymentToGroup;
  72.     /**
  73.      * @ORM\ManyToOne(targetEntity=School::class, inversedBy="groups", fetch="EAGER")
  74.      * @ORM\JoinColumn(nullable=true)
  75.      */
  76.     private $school;
  77.     /**
  78.      * @ORM\Column(type="boolean", options={"default": false})
  79.      */
  80.     private $deleted false;
  81.     /**
  82.      * @ORM\Column(type="string", length=255, unique=true)
  83.      */
  84.     private $uuid;
  85.     public function __construct()
  86.     {
  87.         $this->lessons = new ArrayCollection();
  88.         $this->studentsToGroups = new ArrayCollection();
  89.         $this->potencialClients = new ArrayCollection();
  90.         $this->potentialClients = new ArrayCollection();
  91.     }
  92.     public function getId(): ?int
  93.     {
  94.         return $this->id;
  95.     }
  96.     public function getCourse(): ?course
  97.     {
  98.         return $this->course;
  99.     }
  100.     public function setCourse(?course $course): self
  101.     {
  102.         $this->course $course;
  103.         return $this;
  104.     }
  105.     public function getDateStart(): ?string
  106.     {
  107.         return $this->date_start;
  108.     }
  109.     public function setDateStart(string $date_start): self
  110.     {
  111.         $this->date_start $date_start;
  112.         return $this;
  113.     }
  114.     /**
  115.      * @return Collection<int, Lesson>
  116.      */
  117.     public function getLessons(): Collection
  118.     {
  119.         return $this->lessons;
  120.     }
  121.     public function addLesson(Lesson $lesson): self
  122.     {
  123.         if (!$this->lessons->contains($lesson)) {
  124.             $this->lessons[] = $lesson;
  125.             $lesson->setGroupId($this);
  126.         }
  127.         return $this;
  128.     }
  129.     public function removeLesson(Lesson $lesson): self
  130.     {
  131.         if ($this->lessons->removeElement($lesson)) {
  132.             // set the owning side to null (unless already changed)
  133.             if ($lesson->getGroupId() === $this) {
  134.                 $lesson->setGroupId(null);
  135.             }
  136.         }
  137.         return $this;
  138.     }
  139.     /**
  140.      * @return Collection<int, StudentsToGroup>
  141.      */
  142.     public function getStudentsToGroups(): Collection
  143.     {
  144.         return $this->studentsToGroups;
  145.     }
  146.     public function addStudentsToGroup(StudentsToGroup $studentsToGroup): self
  147.     {
  148.         if (!$this->studentsToGroups->contains($studentsToGroup)) {
  149.             $this->studentsToGroups[] = $studentsToGroup;
  150.             $studentsToGroup->setClass($this);
  151.         }
  152.         return $this;
  153.     }
  154.     public function removeStudentsToGroup(StudentsToGroup $studentsToGroup): self
  155.     {
  156.         if ($this->studentsToGroups->removeElement($studentsToGroup)) {
  157.             // set the owning side to null (unless already changed)
  158.             if ($studentsToGroup->getClass() === $this) {
  159.                 $studentsToGroup->setClass(null);
  160.             }
  161.         }
  162.         return $this;
  163.     }
  164.     public function getGroupToTeacher(): ?GroupToTeacher
  165.     {
  166.         return $this->groupToTeacher;
  167.     }
  168.     public function setGroupToTeacher(?GroupToTeacher $groupToTeacher): self
  169.     {
  170.         // unset the owning side of the relation if necessary
  171.         if ($groupToTeacher === null && $this->groupToTeacher !== null) {
  172.             $this->groupToTeacher->setGroupId(null);
  173.         }
  174.         // set the owning side of the relation if necessary
  175.         if ($groupToTeacher !== null && $groupToTeacher->getGroupId() !== $this) {
  176.             $groupToTeacher->setGroupId($this);
  177.         }
  178.         $this->groupToTeacher $groupToTeacher;
  179.         return $this;
  180.     }
  181.     public function getDay(): ?string
  182.     {
  183.         return $this->day;
  184.     }
  185.     public function setDay(?string $day): self
  186.     {
  187.         $this->day $day;
  188.         return $this;
  189.     }
  190.     public function getHour(): ?string
  191.     {
  192.         return $this->hour;
  193.     }
  194.     public function setHour(?string $hour): self
  195.     {
  196.         $this->hour $hour;
  197.         return $this;
  198.     }
  199.     public function getProjectUrl(): ?string
  200.     {
  201.         return $this->project_url;
  202.     }
  203.     public function setProjectUrl(?string $project_url): self
  204.     {
  205.         $this->project_url $project_url;
  206.         return $this;
  207.     }
  208.     public function getZoomUrl(): ?string
  209.     {
  210.         return $this->zoom_url;
  211.     }
  212.     public function setZoomUrl(?string $zoom_url): self
  213.     {
  214.         $this->zoom_url $zoom_url;
  215.         return $this;
  216.     }
  217.     public function getStatus(): ?int
  218.     {
  219.         return $this->status;
  220.     }
  221.     public function setStatus(int $status): self
  222.     {
  223.         $this->status $status;
  224.         return $this;
  225.     }
  226.     /**
  227.      * @return Collection<int, PotentialClient>
  228.      */
  229.     public function getPotencialClients(): Collection
  230.     {
  231.         return $this->potencialClients;
  232.     }
  233.     public function addPotencialClient(PotentialClient $potencialClient): self
  234.     {
  235.         if (!$this->potencialClients->contains($potencialClient)) {
  236.             $this->potencialClients[] = $potencialClient;
  237.             $potencialClient->setGroups($this);
  238.         }
  239.         return $this;
  240.     }
  241.     public function removePotencialClient(PotentialClient $potencialClient): self
  242.     {
  243.         if ($this->potencialClients->removeElement($potencialClient)) {
  244.             // set the owning side to null (unless already changed)
  245.             if ($potencialClient->getGroups() === $this) {
  246.                 $potencialClient->setGroups(null);
  247.             }
  248.         }
  249.         return $this;
  250.     }
  251.     public function getType(): ?string
  252.     {
  253.         return $this->type;
  254.     }
  255.     public function setType(?string $type): self
  256.     {
  257.         $this->type $type;
  258.         return $this;
  259.     }
  260.     public function getPaymentToGroup(): ?PaymentToGroup
  261.     {
  262.         return $this->paymentToGroup;
  263.     }
  264.     public function setPaymentToGroup(?PaymentToGroup $paymentToGroup): self
  265.     {
  266.         // unset the owning side of the relation if necessary
  267.         if ($paymentToGroup === null && $this->paymentToGroup !== null) {
  268.             $this->paymentToGroup->setCourseGroup(null);
  269.         }
  270.         // set the owning side of the relation if necessary
  271.         if ($paymentToGroup !== null && $paymentToGroup->getCourseGroup() !== $this) {
  272.             $paymentToGroup->setCourseGroup($this);
  273.         }
  274.         $this->paymentToGroup $paymentToGroup;
  275.         return $this;
  276.     }
  277.     public function getSchool(): ?School
  278.     {
  279.         return $this->school;
  280.     }
  281.     public function setSchool(?School $school): self
  282.     {
  283.         $this->school $school;
  284.         return $this;
  285.     }
  286.     public function __toString()
  287.     {
  288.         return $this->getId();
  289.     }
  290.     /**
  291.      * @return Collection<int, PotentialClient>
  292.      */
  293.     public function getPotentialClients(): Collection
  294.     {
  295.         return $this->potentialClients;
  296.     }
  297.     public function addPotentialClient(PotentialClient $potentialClient): static
  298.     {
  299.         if (!$this->potentialClients->contains($potentialClient)) {
  300.             $this->potentialClients->add($potentialClient);
  301.             $potentialClient->setGroups($this);
  302.         }
  303.         return $this;
  304.     }
  305.     public function removePotentialClient(PotentialClient $potentialClient): static
  306.     {
  307.         if ($this->potentialClients->removeElement($potentialClient)) {
  308.             // set the owning side to null (unless already changed)
  309.             if ($potentialClient->getGroups() === $this) {
  310.                 $potentialClient->setGroups(null);
  311.             }
  312.         }
  313.         return $this;
  314.     }
  315.     public function isDeleted(): bool
  316.     {
  317.         return $this->deleted;
  318.     }
  319.     public function setDeleted(bool $deleted): self
  320.     {
  321.         $this->deleted $deleted;
  322.         return $this;
  323.     }
  324.     public function getUuid(): ?string
  325.     {
  326.         return $this->uuid;
  327.     }
  328.     public function setUuid(string $uuid): self
  329.     {
  330.         $this->uuid $uuid;
  331.         return $this;
  332.     }
  333. }