EducationalProjectPublic.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. namespace AppBundle\Entity\Booking;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Dunglas\ApiBundle\Annotation\Iri;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use AppBundle\Entity\Traits\TimestampableEntity;
  9. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  10. /**
  11. * Type de public d'une prestation pédagogique EducationnalProject
  12. *
  13. * @Iri("http://schema.org/EducationalProjectPublic")
  14. */
  15. #[ORM\Entity]
  16. class EducationalProjectPublic
  17. {
  18. use TimestampableEntity;
  19. use CreatorUpdaterEntity;
  20. /**
  21. * @var int
  22. */
  23. #[ORM\Column(type: 'integer')]
  24. #[ORM\Id]
  25. #[ORM\GeneratedValue(strategy: 'AUTO')]
  26. #[Groups(['educationalprojectpublic', 'educationalproject_details'])]
  27. private $id;
  28. /**
  29. * @var string
  30. */
  31. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  32. #[Assert\Type(type: 'string')]
  33. #[Assert\Choice(callback: ['\AppBundle\Enum\Booking\EducationalProjectPublicFamillyEnum', 'toArray'])]
  34. #[Groups(['educationalprojectpublic'])]
  35. private $familly;
  36. /**
  37. * @var string
  38. */
  39. #[ORM\Column(type: 'string', length: 255)]
  40. #[Assert\Type(type: 'string')]
  41. #[Assert\NotNull]
  42. #[Assert\Choice(callback: ['\AppBundle\Enum\Booking\EducationalProjectPublicFamillyEnum', 'toArray'])]
  43. #[Groups(['educationalprojectpublic', 'educationalproject_details_public'])]
  44. private $subFamilly;
  45. /**
  46. * @var ArrayCollection<EducationalProject>
  47. */
  48. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\EducationalProject', mappedBy: 'public')]
  49. #[Groups(['educationalprojectpublic_educationalproject'])]
  50. private $educationalProjects;
  51. /**
  52. * Constructor
  53. */
  54. public function __construct()
  55. {
  56. $this->educationalProjects = new ArrayCollection();
  57. }
  58. /**
  59. * Sets id.
  60. *
  61. * @param int $id
  62. *
  63. * @return $this
  64. */
  65. public function setId($id)
  66. {
  67. $this->id = $id;
  68. return $this;
  69. }
  70. /**
  71. * Gets id.
  72. *
  73. * @return int
  74. */
  75. public function getId()
  76. {
  77. return $this->id;
  78. }
  79. /**
  80. * Sets familly.
  81. *
  82. * @param string $familly
  83. *
  84. * @return $this
  85. */
  86. public function setFamilly($familly)
  87. {
  88. $this->familly = $familly;
  89. return $this;
  90. }
  91. /**
  92. * Gets familly.
  93. *
  94. * @return string
  95. */
  96. public function getFamilly()
  97. {
  98. return $this->familly;
  99. }
  100. /**
  101. * Sets subFamilly.
  102. *
  103. * @param string $subFamilly
  104. *
  105. * @return $this
  106. */
  107. public function setSubFamilly($subFamilly)
  108. {
  109. $this->subFamilly = $subFamilly;
  110. return $this;
  111. }
  112. /**
  113. * Gets subFamilly.
  114. *
  115. * @return string
  116. */
  117. public function getSubFamilly()
  118. {
  119. return $this->subFamilly;
  120. }
  121. /**
  122. * Add educationalProject
  123. *
  124. * @param \AppBundle\Entity\Booking\EducationalProject $educationalProject
  125. *
  126. * @return EducationalProjectPublic
  127. */
  128. public function addEducationalProject(\AppBundle\Entity\Booking\EducationalProject $educationalProject)
  129. {
  130. $this->educationalProjects[] = $educationalProject;
  131. return $this;
  132. }
  133. /**
  134. * Remove educationalProject
  135. *
  136. * @param \AppBundle\Entity\Booking\EducationalProject $educationalProject
  137. */
  138. public function removeEducationalProject(\AppBundle\Entity\Booking\EducationalProject $educationalProject)
  139. {
  140. $this->educationalProjects->removeElement($educationalProject);
  141. }
  142. /**
  143. * Get educationalProjects
  144. *
  145. * @return \Doctrine\Common\Collections\Collection
  146. */
  147. public function getEducationalProjects()
  148. {
  149. return $this->educationalProjects;
  150. }
  151. }