src/Entity/TeacherDisciplineClass.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TeacherDisciplineClassRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9. * @ORM\Entity(repositoryClass=TeacherDisciplineClassRepository::class)
  10. */
  11. class TeacherDisciplineClass
  12. {
  13. /**
  14. * @ORM\Id
  15. * @ORM\GeneratedValue
  16. * @ORM\Column(type="integer")
  17. * @Groups({"TeacherDisciplineClassesEdit"})
  18. */
  19. private $id;
  20. /**
  21. * @ORM\ManyToOne(targetEntity=Discipline::class, inversedBy="teacherDisciplineClasses")
  22. * @Groups({"TeacherDisciplineClassesEdit","TeacherList"})
  23. */
  24. private $discipline;
  25. /**
  26. * @ORM\Column(type="integer", nullable=true)
  27. * @Groups({"TeacherDisciplineClassesEdit","TeacherList"})
  28. */
  29. private $maxClass;
  30. /**
  31. * @ORM\ManyToOne(targetEntity=Teacher::class, inversedBy="teacherDisciplineClasses")
  32. */
  33. private $teacher;
  34. /**
  35. * @ORM\Column(type="json", nullable=true)
  36. * @Groups({"TeacherDisciplineClassesEdit","TeacherList"})
  37. */
  38. private $classes = [];
  39. /**
  40. * @ORM\Column(type="integer", nullable=true)
  41. * @Groups({"TeacherDisciplineClassesEdit","TeacherList"})
  42. */
  43. private $vbe;
  44. /**
  45. * @ORM\Column(type="json", nullable=true)
  46. * @Groups({"TeacherDisciplineClassesEdit","TeacherList"})
  47. */
  48. private $classYears = [];
  49. public function __construct()
  50. {
  51. }
  52. public function getId(): ?int
  53. {
  54. return $this->id;
  55. }
  56. public function getDiscipline(): ?Discipline
  57. {
  58. return $this->discipline;
  59. }
  60. public function setDiscipline(?Discipline $discipline): self
  61. {
  62. $this->discipline = $discipline;
  63. return $this;
  64. }
  65. public function getMaxClass(): ?int
  66. {
  67. return $this->maxClass;
  68. }
  69. public function setMaxClass(?int $maxClass): self
  70. {
  71. $this->maxClass = $maxClass;
  72. return $this;
  73. }
  74. public function getTeacher(): ?Teacher
  75. {
  76. return $this->teacher;
  77. }
  78. public function setTeacher(?Teacher $teacher): self
  79. {
  80. $this->teacher = $teacher;
  81. return $this;
  82. }
  83. public function getClasses(): ?array
  84. {
  85. return $this->classes ?: [];
  86. }
  87. public function setClasses(?array $classes): self
  88. {
  89. $this->classes = $classes;
  90. return $this;
  91. }
  92. public function getVbe(): ?int
  93. {
  94. return $this->vbe;
  95. }
  96. public function setVbe(?int $vbe): self
  97. {
  98. $this->vbe = $vbe;
  99. return $this;
  100. }
  101. public function getClassYears(): ?array
  102. {
  103. if(!is_array($this->classYears))
  104. {
  105. $this->classYears = [];
  106. }
  107. sort($this->classYears);
  108. return $this->classYears;
  109. }
  110. public function setClassYears(?array $classYears): self
  111. {
  112. $this->classYears = $classYears;
  113. return $this;
  114. }
  115. }