EducationCategory.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?php
  2. namespace AppBundle\Entity\Education;
  3. use AppBundle\Entity\Organization\Organization;
  4. use AppBundle\Annotation\DefaultField;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Dunglas\ApiBundle\Annotation\Iri;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use AppBundle\Entity\Traits\TimestampableEntity;
  11. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  12. /**
  13. * Catégorie de l'enseignement Education
  14. *
  15. * @Iri("http://schema.org/EducationCategory")
  16. */
  17. #[ORM\Entity]
  18. class EducationCategory
  19. {
  20. use TimestampableEntity;
  21. use CreatorUpdaterEntity;
  22. /**
  23. * @var int
  24. */
  25. #[ORM\Column(type: 'integer')]
  26. #[ORM\Id]
  27. #[ORM\GeneratedValue(strategy: 'AUTO')]
  28. #[Groups(['educationcategory', 'education_reference', 'planning_list', 'access_details_practicalcourses', 'student_list_courses', 'educationstudent_reference_educationcurriculum', 'educations_quotas_by_education_list', 'educations_quotas_stats'])]
  29. private $id;
  30. /**
  31. * @var Organization
  32. *
  33. * @DefaultField
  34. */
  35. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization', inversedBy: 'educationCategories')]
  36. #[ORM\JoinColumn(nullable: false)]
  37. #[Assert\NotNull]
  38. #[Groups(['educationcategory'])]
  39. private $organization;
  40. /**
  41. * @var string
  42. */
  43. #[ORM\Column(type: 'string', nullable: true)]
  44. #[Assert\Type(type: 'string')]
  45. #[Assert\NotNull]
  46. #[Assert\Choice(callback: ['\AppBundle\Enum\Education\EducationTypeEnum', 'toArray'])]
  47. #[Groups(['educationcategory', 'access_details_educationstudent', 'educations_quotas_by_education_list_educationcategory'])]
  48. private $educationTypeEnum;
  49. /**
  50. * @var string
  51. */
  52. #[ORM\Column(type: 'string')]
  53. #[Assert\Type(type: 'string')]
  54. #[Assert\NotNull]
  55. #[Groups(['educationcategory', 'access_details_educationstudent', 'educationcategory_reference', 'educationcurriculum_reference_education', 'education_reference_educationcategory', 'student_list_educationstudent', 'intangible_list_educationcurriculums', 'examenconvocation_list_examen', 'my_student_list_educationcurriculum', 'planning_list', 'attendancebooking_list_course', 'generate_attendance', 'report_card_educationstudent', 'access_details_practicalcourses', 'presence_attendance_education', 'student_list_courses', 'examen_details_education', 'course_details_education', 'educationstudent_reference_educationcurriculum', 'edu_stu_courses_courses', 'student_registration_courses', 'educationnotation_list_educationstudent', 'accesses_courseteacher_show_practicalcourses', 'planning_detail_education', 'education_input_list_educationcurriculum', 'education_input_list_access', 'education_input_list_access', 'access_attendance_detail_attendancebookings', 'education_student_wish_list_educationwish', 'education_student_next_year_educationcurriculum', 'education_student_next_year_educationstudentlastyear', 'access_intangible_list_intangible', 'worksbyusers_db_work', 'accesses_no_reregistred_list_educationstudent', 'educationstudent_notation_educationcurriculum', 'educations_quotas_by_education_list_educationcategory'])]
  56. private $label;
  57. /**
  58. * @var ArrayCollection<Education>
  59. */
  60. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Education\Education', mappedBy: 'educationCategory', orphanRemoval: true)]
  61. #[Groups(['educationcategory_education'])]
  62. private $educations;
  63. /**
  64. * Constructor
  65. */
  66. public function __construct()
  67. {
  68. $this->educations = new ArrayCollection();
  69. }
  70. /**
  71. * Sets id.
  72. *
  73. * @param int $id
  74. *
  75. * @return $this
  76. */
  77. public function setId($id)
  78. {
  79. $this->id = $id;
  80. return $this;
  81. }
  82. /**
  83. * Gets id.
  84. *
  85. * @return int
  86. */
  87. public function getId()
  88. {
  89. return $this->id;
  90. }
  91. /**
  92. * Sets organization.
  93. *
  94. * @param Organization $organization
  95. *
  96. * @return $this
  97. */
  98. public function setOrganization(Organization $organization)
  99. {
  100. $this->organization = $organization;
  101. return $this;
  102. }
  103. /**
  104. * Gets organization.
  105. *
  106. * @return Organization
  107. */
  108. public function getOrganization()
  109. {
  110. return $this->organization;
  111. }
  112. /**
  113. * Sets educationTypeEnum.
  114. *
  115. * @param String $educationTypeEnum
  116. *
  117. * @return $this
  118. */
  119. public function setEducationTypeEnum($educationTypeEnum)
  120. {
  121. $this->educationTypeEnum = $educationTypeEnum;
  122. return $this;
  123. }
  124. /**
  125. * Gets educationTypeEnum.
  126. *
  127. * @return String
  128. */
  129. public function getEducationTypeEnum()
  130. {
  131. return $this->educationTypeEnum;
  132. }
  133. /**
  134. * Sets label.
  135. *
  136. * @param string $label
  137. *
  138. * @return $this
  139. */
  140. public function setLabel($label)
  141. {
  142. $this->label = $label;
  143. return $this;
  144. }
  145. /**
  146. * Gets label.
  147. *
  148. * @return string
  149. */
  150. public function getLabel()
  151. {
  152. return $this->label;
  153. }
  154. /**
  155. * Add education
  156. *
  157. * @param \AppBundle\Entity\Education\Education $education
  158. *
  159. * @return EducationCategory
  160. */
  161. public function addEducation(\AppBundle\Entity\Education\Education $education)
  162. {
  163. $this->educations[] = $education;
  164. return $this;
  165. }
  166. /**
  167. * Remove education
  168. *
  169. * @param \AppBundle\Entity\Education\Education $education
  170. */
  171. public function removeEducation(\AppBundle\Entity\Education\Education $education)
  172. {
  173. $this->educations->removeElement($education);
  174. }
  175. /**
  176. * Get educations
  177. *
  178. * @return \Doctrine\Common\Collections\Collection
  179. */
  180. public function getEducations()
  181. {
  182. return $this->educations;
  183. }
  184. }