CommissionMember.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?php
  2. namespace AppBundle\Entity\Person;
  3. use AppBundle\Entity\AccessAndFunction\Access;
  4. use AppBundle\Entity\Traits\ActivityPeriodTrait;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Dunglas\ApiBundle\Annotation\Iri;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use AppBundle\Entity\Traits\TimestampableEntity;
  10. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  11. /**
  12. * Membre d'une commission, fais le lien entre un Access et une Commission
  13. *
  14. * @Iri("http://schema.org/CommissionMember")
  15. */
  16. #[ORM\Entity]
  17. class CommissionMember
  18. {
  19. use TimestampableEntity;
  20. use CreatorUpdaterEntity;
  21. use ActivityPeriodTrait;
  22. /**
  23. * @var int
  24. */
  25. #[ORM\Column(type: 'integer')]
  26. #[ORM\Id]
  27. #[ORM\GeneratedValue(strategy: 'AUTO')]
  28. #[Groups(['commissionmember', 'commission_list'])]
  29. private $id;
  30. /**
  31. * @var Commission
  32. */
  33. #[ORM\ManyToOne(targetEntity: 'Commission', inversedBy: 'commissionMembers')]
  34. #[ORM\JoinColumn(nullable: false)]
  35. #[Assert\NotNull]
  36. #[Groups(['commissionmember'])]
  37. private $commission;
  38. /**
  39. * @var Access
  40. */
  41. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'commissionMembers')]
  42. #[ORM\JoinColumn(nullable: false)]
  43. #[Assert\NotNull]
  44. #[Groups(['commissionmember', 'commission_list_commissionmembers'])]
  45. private $member;
  46. /**
  47. * @var string
  48. */
  49. #[ORM\Column(type: 'string', nullable: true)]
  50. #[Assert\Type(type: 'string')]
  51. #[Assert\Choice(callback: ['AppBundle\Enum\Person\CommissionMemberFunctionEnum', 'toArray'])]
  52. #[Groups(['commissionmember', 'commission_list_commissionmembers'])]
  53. private $commissionMemberFunction;
  54. /**
  55. * @var string
  56. */
  57. #[ORM\Column(type: 'string', length: 30, nullable: true)]
  58. #[Assert\Type(type: 'string')]
  59. #[Groups(['commissionmember', 'commission_list_commissionmembers'])]
  60. private $functionComplement;
  61. /**
  62. * @var string
  63. */
  64. #[ORM\Column(type: 'string', nullable: true)]
  65. #[Assert\Type(type: 'string')]
  66. #[Assert\Choice(callback: ['AppBundle\Enum\Person\CauseOutputEnum', 'toArray'])]
  67. #[Groups(['commissionmember', 'commission_list_commissionmembers'])]
  68. private $causeOutput;
  69. /**
  70. * Constructor
  71. */
  72. public function __construct()
  73. {
  74. }
  75. /**
  76. * Sets id.
  77. *
  78. * @param int $id
  79. *
  80. * @return $this
  81. */
  82. public function setId($id)
  83. {
  84. $this->id = $id;
  85. return $this;
  86. }
  87. /**
  88. * Gets id.
  89. *
  90. * @return int
  91. */
  92. public function getId()
  93. {
  94. return $this->id;
  95. }
  96. /**
  97. * Sets commission.
  98. *
  99. * @param Commission $commission
  100. *
  101. * @return $this
  102. */
  103. public function setCommission(Commission $commission)
  104. {
  105. $this->commission = $commission;
  106. return $this;
  107. }
  108. /**
  109. * Gets commission.
  110. *
  111. * @return Commission
  112. */
  113. public function getCommission()
  114. {
  115. return $this->commission;
  116. }
  117. /**
  118. * Sets member.
  119. *
  120. * @param Access $member
  121. *
  122. * @return $this
  123. */
  124. public function setMember(Access $member)
  125. {
  126. $this->member = $member;
  127. return $this;
  128. }
  129. /**
  130. * Gets member.
  131. *
  132. * @return Access
  133. */
  134. public function getMember()
  135. {
  136. return $this->member;
  137. }
  138. /**
  139. * Sets commissionMemberFunction.
  140. *
  141. * @param string $commissionMemberFunction
  142. *
  143. * @return $this
  144. */
  145. public function setCommissionMemberFunction($commissionMemberFunction)
  146. {
  147. $this->commissionMemberFunction = $commissionMemberFunction;
  148. return $this;
  149. }
  150. /**
  151. * Gets commissionMemberFunction.
  152. *
  153. * @return string
  154. */
  155. public function getCommissionMemberFunction()
  156. {
  157. return $this->commissionMemberFunction;
  158. }
  159. /**
  160. * Sets functionComplement.
  161. *
  162. * @param string $functionComplement
  163. *
  164. * @return $this
  165. */
  166. public function setFunctionComplement($functionComplement)
  167. {
  168. $this->functionComplement = $functionComplement;
  169. return $this;
  170. }
  171. /**
  172. * Gets functionComplement.
  173. *
  174. * @return string
  175. */
  176. public function getFunctionComplement()
  177. {
  178. return $this->functionComplement;
  179. }
  180. /**
  181. * Sets causeOutput.
  182. *
  183. * @param string $causeOutput
  184. *
  185. * @return $this
  186. */
  187. public function setCauseOutput($causeOutput)
  188. {
  189. $this->causeOutput = $causeOutput;
  190. return $this;
  191. }
  192. /**
  193. * Gets causeOutput.
  194. *
  195. * @return string
  196. */
  197. public function getCauseOutput()
  198. {
  199. return $this->causeOutput;
  200. }
  201. }