<?php
namespace App\Entity;
use App\Entity\GuardianRegister\GuardianRegisterChildPreference;
use App\Repository\DisciplineRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=DisciplineRepository::class)
*/
class Discipline
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"TeacherDisciplineClassesEdit","ResponsesList", "TeacherResponsesList", "ChildPreferenceAssignmentList", "DeclineHistoryList"})
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"LessonList","ChildPreferenceList","TeacherList","ResponsesList","TeacherSurveyList", "TeacherResponsesList", "ChildPreferenceAssignmentList", "DeclineHistoryList","TeacherRegisterList","ChildLessonReviewList"})
*/
private $name;
/**
* @ORM\OneToMany(targetEntity=ChildPreference::class, mappedBy="discipline")
*/
private $childPreferences;
/**
* @ORM\OneToMany(targetEntity=ChildPreferenceHistory::class, mappedBy="discipline")
*/
private $childPreferenceHistories;
/**
* @ORM\OneToMany(targetEntity=Lesson::class, mappedBy="discipline")
*/
private $lessons;
/**
* @ORM\ManyToMany(targetEntity=Teacher::class, mappedBy="disciplines")
*/
private $teachers;
/**
* @ORM\OneToMany(targetEntity=TeacherDisciplineClass::class, mappedBy="discipline")
*/
private $teacherDisciplineClasses;
/**
* @ORM\OneToMany(targetEntity=GuardianSurveyResponse::class, mappedBy="discipline")
*/
private $guardianSurveyResponses;
/**
* @ORM\OneToMany(targetEntity=TeacherSurveyResponse::class, mappedBy="discipline")
*/
private $teacherSurveyResponses;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"TeacherRegisterList"})
*/
private $displayName;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $vbeDate;
/**
* @ORM\OneToMany(targetEntity=GuardianRegisterChildPreference::class, mappedBy="discipline")
*/
private $guardianRegisterChildPreferences;
/**
* @ORM\OneToMany(targetEntity=ChildPreferenceDeclineHistory::class, mappedBy="discipline")
*/
private $childPreferenceDeclineHistories;
public function __construct()
{
$this->childPreferences = new ArrayCollection();
$this->childPreferenceHistories = new ArrayCollection();
$this->lessons = new ArrayCollection();
$this->teachers = new ArrayCollection();
$this->teacherDisciplineClasses = new ArrayCollection();
$this->guardianSurveyResponses = new ArrayCollection();
$this->teacherSurveyResponses = new ArrayCollection();
$this->guardianRegisterChildPreferences = new ArrayCollection();
$this->childPreferenceDeclineHistories = 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;
}
/**
* @return Collection|ChildPreferenceHistory[]
*/
public function getChildPreferenceHistories(): Collection
{
return $this->childPreferenceHistories;
}
/**
* @return Collection|ChildPreference[]
*/
public function getChildPreferences(): Collection
{
return $this->childPreferences;
}
public function addChildPreference(ChildPreference $childPreference): self
{
if (!$this->childPreferences->contains($childPreference)) {
$this->childPreferences[] = $childPreference;
$childPreference->setDiscipline($this);
}
return $this;
}
public function removeChildPreference(ChildPreference $childPreference): self
{
if ($this->childPreferences->removeElement($childPreference)) {
// set the owning side to null (unless already changed)
if ($childPreference->getDiscipline() === $this) {
$childPreference->setDiscipline(null);
}
}
return $this;
}
public function __toString()
{
return "{$this->name}";
}
/**
* @return Collection|Lesson[]
*/
public function getLessons(): Collection
{
return $this->lessons;
}
public function addLesson(Lesson $lesson): self
{
if (!$this->lessons->contains($lesson)) {
$this->lessons[] = $lesson;
$lesson->setDiscipline($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->getDiscipline() === $this) {
$lesson->setDiscipline(null);
}
}
return $this;
}
/**
* @return Collection|Teacher[]
*/
public function getTeachers(): Collection
{
return $this->teachers;
}
public function addTeacher(Teacher $teacher): self
{
if (!$this->teachers->contains($teacher)) {
$this->teachers[] = $teacher;
$teacher->addDiscipline($this);
}
return $this;
}
public function removeTeacher(Teacher $teacher): self
{
if ($this->teachers->removeElement($teacher)) {
$teacher->removeDiscipline($this);
}
return $this;
}
/**
* @return Collection|TeacherDisciplineClass[]
*/
public function getTeacherDisciplineClasses(): Collection
{
return $this->teacherDisciplineClasses;
}
public function addTeacherDisciplineClass(TeacherDisciplineClass $teacherDisciplineClass): self
{
if (!$this->teacherDisciplineClasses->contains($teacherDisciplineClass)) {
$this->teacherDisciplineClasses[] = $teacherDisciplineClass;
$teacherDisciplineClass->setDiscipline($this);
}
return $this;
}
public function removeTeacherDisciplineClass(TeacherDisciplineClass $teacherDisciplineClass): self
{
if ($this->teacherDisciplineClasses->removeElement($teacherDisciplineClass)) {
// set the owning side to null (unless already changed)
if ($teacherDisciplineClass->getDiscipline() === $this) {
$teacherDisciplineClass->setDiscipline(null);
}
}
return $this;
}
/**
* @return Collection|GuardianSurveyResponse[]
*/
public function getGuardianSurveyResponses(): Collection
{
return $this->guardianSurveyResponses;
}
public function addGuardianSurveyResponse(GuardianSurveyResponse $guardianSurveyResponse): self
{
if (!$this->guardianSurveyResponses->contains($guardianSurveyResponse)) {
$this->guardianSurveyResponses[] = $guardianSurveyResponse;
$guardianSurveyResponse->setDiscipline($this);
}
return $this;
}
public function removeGuardianSurveyResponse(GuardianSurveyResponse $guardianSurveyResponse): self
{
if ($this->guardianSurveyResponses->removeElement($guardianSurveyResponse)) {
// set the owning side to null (unless already changed)
if ($guardianSurveyResponse->getDiscipline() === $this) {
$guardianSurveyResponse->setDiscipline(null);
}
}
return $this;
}
/**
* @return Collection|TeacherSurveyResponse[]
*/
public function getTeacherSurveyResponses(): Collection
{
return $this->teacherSurveyResponses;
}
public function addTeacherSurveyResponse(TeacherSurveyResponse $teacherSurveyResponse): self
{
if (!$this->teacherSurveyResponses->contains($teacherSurveyResponse)) {
$this->teacherSurveyResponses[] = $teacherSurveyResponse;
$teacherSurveyResponse->setDiscipline($this);
}
return $this;
}
public function removeTeacherSurveyResponse(TeacherSurveyResponse $teacherSurveyResponse): self
{
if ($this->teacherSurveyResponses->removeElement($teacherSurveyResponse)) {
// set the owning side to null (unless already changed)
if ($teacherSurveyResponse->getDiscipline() === $this) {
$teacherSurveyResponse->setDiscipline(null);
}
}
return $this;
}
public function getDisplayName(): ?string
{
return $this->displayName;
}
public function setDisplayName(?string $displayName): self
{
$this->displayName = $displayName;
return $this;
}
public function getVbeDate(): ?\DateTimeInterface
{
return $this->vbeDate;
}
public function setVbeDate(?\DateTimeInterface $vbeDate): self
{
$this->vbeDate = $vbeDate;
return $this;
}
/**
* @return Collection<int, GuardianRegisterChildPreference>
*/
public function getGuardianRegisterChildPreferences(): Collection
{
return $this->guardianRegisterChildPreferences;
}
public function addGuardianRegisterChildPreference(GuardianRegisterChildPreference $guardianRegisterChildPreference): self
{
if (!$this->guardianRegisterChildPreferences->contains($guardianRegisterChildPreference)) {
$this->guardianRegisterChildPreferences[] = $guardianRegisterChildPreference;
$guardianRegisterChildPreference->setDiscipline($this);
}
return $this;
}
public function removeGuardianRegisterChildPreference(GuardianRegisterChildPreference $guardianRegisterChildPreference): self
{
if ($this->guardianRegisterChildPreferences->removeElement($guardianRegisterChildPreference)) {
// set the owning side to null (unless already changed)
if ($guardianRegisterChildPreference->getDiscipline() === $this) {
$guardianRegisterChildPreference->setDiscipline(null);
}
}
return $this;
}
/**
* @return Collection<int, ChildPreferenceDeclineHistory>
*/
public function getChildPreferenceDeclineHistories(): Collection
{
return $this->childPreferenceDeclineHistories;
}
public function addChildPreferenceDeclineHistory(ChildPreferenceDeclineHistory $childPreferenceDeclineHistory): self
{
if (!$this->childPreferenceDeclineHistories->contains($childPreferenceDeclineHistory)) {
$this->childPreferenceDeclineHistories[] = $childPreferenceDeclineHistory;
$childPreferenceDeclineHistory->setDiscipline($this);
}
return $this;
}
public function removeChildPreferenceDeclineHistory(ChildPreferenceDeclineHistory $childPreferenceDeclineHistory): self
{
if ($this->childPreferenceDeclineHistories->removeElement($childPreferenceDeclineHistory)) {
// set the owning side to null (unless already changed)
if ($childPreferenceDeclineHistory->getDiscipline() === $this) {
$childPreferenceDeclineHistory->setDiscipline(null);
}
}
return $this;
}
}