<?php
namespace App\Entity;
use App\Repository\CourseGroupRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CourseGroupRepository::class)
*/
class CourseGroup
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string", length=8192, nullable=true)
*/
private $description;
/**
* @ORM\Column(type="integer")
*/
private $isMain;
/**
* @ORM\Column(type="integer")
*/
private $hidden;
/**
* @ORM\Column(type="string", length=4096, nullable=true)
*/
private $photo;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $studentAge;
/**
* @ORM\OneToMany(targetEntity=CourseToGroup::class, mappedBy="Groups", cascade={"persist", "remove"})
*/
private $courseToGroup;
public function __construct()
{
$this->courseToGroup = 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 getCourseToGroup(): ?CourseToGroup
{
return $this->courseToGroup;
}
public function setCourseToGroup(CourseToGroup $courseToGroup): self
{
// set the owning side of the relation if necessary
if ($courseToGroup->getGroups() !== $this) {
$courseToGroup->setGroups($this);
}
$this->courseToGroup = $courseToGroup;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getIsMain(): ?int
{
return $this->isMain;
}
public function setIsMain(?string $isMain): self
{
$this->isMain = $isMain;
return $this;
}
public function getHidden(): ?int
{
return $this->hidden;
}
public function setHidden(?string $hidden): self
{
$this->hidden = $hidden;
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(?string $photo): self
{
$this->photo = $photo;
return $this;
}
public function getStudentAge(): ?string
{
return $this->studentAge;
}
public function setStudentAge(?string $studentAge): self
{
$this->studentAge = $studentAge;
return $this;
}
public function addCourseToGroup(CourseToGroup $courseToGroup): static
{
if (!$this->courseToGroup->contains($courseToGroup)) {
$this->courseToGroup->add($courseToGroup);
$courseToGroup->setGroups($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->getGroups() === $this) {
$courseToGroup->setGroups(null);
}
}
return $this;
}
}