EducationNotationCriteriaConfig.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?php
  2. namespace AppBundle\Entity\Education;
  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. * Configuration des critère pour la grille d'évaluation
  12. */
  13. #[ORM\Entity]
  14. class EducationNotationCriteriaConfig
  15. {
  16. use TimestampableEntity;
  17. use CreatorUpdaterEntity;
  18. /**
  19. * @var int
  20. */
  21. #[ORM\Column(type: 'integer')]
  22. #[ORM\Id]
  23. #[ORM\GeneratedValue(strategy: 'AUTO')]
  24. #[Groups(['educationnotationcriteriaconfig'])]
  25. private $id;
  26. /**
  27. * @var EducationNotationConfig
  28. */
  29. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\EducationNotationConfig', inversedBy: 'educationNotationCriteriaConfigs')]
  30. #[Groups(['educationnotationcriteriaconfig', 'report_card_educationstudent'])]
  31. private $educationNotationConfig;
  32. /**
  33. * @var CriteriaNotation
  34. */
  35. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\CriteriaNotation', inversedBy: 'educationNotationCriteriaConfigs')]
  36. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false)]
  37. #[Groups(['educationnotationcriteriaconfig'])]
  38. private $criteriaNotation;
  39. /**
  40. * @var int
  41. */
  42. #[ORM\Column(type: 'integer', options: ['default' => 1])]
  43. #[Assert\Range(min: 1, max: 10)]
  44. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  45. #[Groups(['educationnotationcriteriaconfig', 'report_card_educationstudent'])]
  46. private $coefficient = 1;
  47. /**
  48. * @var ArrayCollection<EducationNotation>
  49. */
  50. #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Education\EducationNotation', mappedBy: 'criteriaNotationConfig')]
  51. #[Groups(['educationnotationcriteriaconfig'])]
  52. private $educationNotations;
  53. public function __construct() {
  54. $this->educationNotations = new ArrayCollection();
  55. }
  56. /**
  57. * Sets id.
  58. *
  59. * @param int $id
  60. *
  61. * @return $this
  62. */
  63. public function setId($id)
  64. {
  65. $this->id = $id;
  66. return $this;
  67. }
  68. /**
  69. * Gets id.
  70. *
  71. * @return int
  72. */
  73. public function getId()
  74. {
  75. return $this->id;
  76. }
  77. /**
  78. * Sets criteriaNotation.
  79. *
  80. * @param CriteriaNotation $criteriaNotation
  81. *
  82. * @return $this
  83. */
  84. public function setCriteriaNotation($criteriaNotation)
  85. {
  86. $this->criteriaNotation = $criteriaNotation;
  87. return $this;
  88. }
  89. /**
  90. * Gets criteriaNotation.
  91. *
  92. * @return CriteriaNotation
  93. */
  94. public function getCriteriaNotation()
  95. {
  96. return $this->criteriaNotation;
  97. }
  98. /**
  99. * Sets educationNotationConfig.
  100. *
  101. * @param EducationNotationConfig $educationNotationConfig
  102. *
  103. * @return $this
  104. */
  105. public function setEducationNotationConfig($educationNotationConfig)
  106. {
  107. $this->educationNotationConfig = $educationNotationConfig;
  108. return $this;
  109. }
  110. /**
  111. * Gets criteriaNotation.
  112. *
  113. * @return EducationNotationConfig
  114. */
  115. public function getEducationNotationConfig()
  116. {
  117. return $this->educationNotationConfig;
  118. }
  119. /**
  120. * Sets label.
  121. *
  122. * @param string $label
  123. *
  124. * @return $this
  125. */
  126. public function setLabel($label)
  127. {
  128. $this->label = $label;
  129. return $this;
  130. }
  131. /**
  132. * Gets label.
  133. *
  134. * @return string
  135. */
  136. public function getLabel()
  137. {
  138. return $this->label;
  139. }
  140. /**
  141. * Sets coefficient.
  142. *
  143. * @param int $coefficient
  144. *
  145. * @return $this
  146. */
  147. public function setCoefficient($coefficient)
  148. {
  149. if($coefficient === null) $coefficient = 1;
  150. $this->coefficient = $coefficient;
  151. return $this;
  152. }
  153. /**
  154. * Gets coefficient.
  155. *
  156. * @return int
  157. */
  158. public function getCoefficient()
  159. {
  160. return $this->coefficient;
  161. }
  162. /**
  163. * Add educationNotation
  164. *
  165. * @param \AppBundle\Entity\Education\EducationNotation $educationNotation
  166. *
  167. * @return EducationNotationCriteriaConfig
  168. */
  169. public function addEducationNotation(\AppBundle\Entity\Education\EducationNotation $educationNotation)
  170. {
  171. $this->educationNotations[] = $educationNotation;
  172. return $this;
  173. }
  174. /**
  175. * Remove educationNotation
  176. *
  177. * @param \AppBundle\Entity\Education\EducationNotation $educationNotation
  178. */
  179. public function removeEducationNotation(\AppBundle\Entity\Education\EducationNotation $educationNotation)
  180. {
  181. $this->educationNotations->removeElement($educationNotation);
  182. }
  183. /**
  184. * Get educationNotations
  185. *
  186. * @return \Doctrine\Common\Collections\Collection
  187. */
  188. public function getEducationNotations()
  189. {
  190. return $this->educationNotations;
  191. }
  192. }