EventGender.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <?php
  2. namespace AppBundle\Entity\Booking;
  3. use AppBundle\Enum\TypeEnum;
  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. * Enum des genres d'évènements
  12. *
  13. * @Iri("http://schema.org/EventGender")
  14. */
  15. #[ORM\Entity]
  16. class EventGender
  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(['eventgender', 'activity_report'])]
  27. private $id;
  28. /**
  29. * @var string
  30. */
  31. #[ORM\Column(type: 'string', length: 100)]
  32. #[Assert\Type(type: 'string')]
  33. #[Assert\NotNull]
  34. #[Groups(['eventgender'])]
  35. private $code;
  36. /**
  37. * @var string
  38. */
  39. #[ORM\Column(type: 'string', length: 100)]
  40. #[Assert\Type(type: 'string')]
  41. #[Assert\NotNull]
  42. #[Groups(['eventgender', 'activity_report'])]
  43. private $name;
  44. /**
  45. * @var string
  46. */
  47. #[ORM\Column(type: 'string')]
  48. #[Assert\Type(type: 'string')]
  49. #[Assert\NotNull]
  50. #[Assert\Choice(callback: ['\AppBundle\Enum\Booking\EventGenderTypeEnum', 'toArray'])]
  51. #[Groups(['eventgender', 'activity_report'])]
  52. private $type;
  53. /**
  54. * Sets id.
  55. *
  56. * @param int $id
  57. *
  58. * @return $this
  59. */
  60. public function setId($id)
  61. {
  62. $this->id = $id;
  63. return $this;
  64. }
  65. /**
  66. * Gets id.
  67. *
  68. * @return int
  69. */
  70. public function getId()
  71. {
  72. return $this->id;
  73. }
  74. /**
  75. * Sets code.
  76. *
  77. * @param string $code
  78. *
  79. * @return $this
  80. */
  81. public function setCode($code)
  82. {
  83. $this->code = $code;
  84. return $this;
  85. }
  86. /**
  87. * Gets code.
  88. *
  89. * @return string
  90. */
  91. public function getCode()
  92. {
  93. return $this->code;
  94. }
  95. /**
  96. * Sets name.
  97. *
  98. * @param string $name
  99. *
  100. * @return $this
  101. */
  102. public function setName($name)
  103. {
  104. $this->name = $name;
  105. return $this;
  106. }
  107. /**
  108. * Gets name.
  109. *
  110. * @return string
  111. */
  112. public function getName()
  113. {
  114. return $this->name;
  115. }
  116. /**
  117. * Sets type.
  118. *
  119. * @param string $type
  120. *
  121. * @return $this
  122. */
  123. public function setType($type)
  124. {
  125. $this->type = $type;
  126. return $this;
  127. }
  128. /**
  129. * Gets type.
  130. *
  131. * @return string
  132. */
  133. public function getType()
  134. {
  135. return $this->type;
  136. }
  137. }