ActivityType.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. namespace AppBundle\Entity\Organization;
  3. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  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. /**
  9. * Type générique d'activités
  10. *
  11. * @Iri("http://schema.org/ActivityType")
  12. */
  13. #[ORM\Entity]
  14. class ActivityType
  15. {
  16. use CreatorUpdaterEntity;
  17. /**
  18. * @var int
  19. */
  20. #[ORM\Column(type: 'integer')]
  21. #[ORM\Id]
  22. #[ORM\GeneratedValue(strategy: 'AUTO')]
  23. #[Groups(['activitytype', 'activity_reference', 'network_list_activities'])]
  24. private $id;
  25. /**
  26. * @var string
  27. */
  28. #[ORM\Column(type: 'string')]
  29. #[Assert\Type(type: 'string')]
  30. #[Assert\Choice(callback: ['\AppBundle\Enum\Organization\FamillyTypeEnum', 'toArray'])]
  31. #[Groups(['activitytype', 'network_list_activities'])]
  32. private $famillyType;
  33. /**
  34. * @var string
  35. */
  36. #[ORM\Column(type: 'string', nullable: false)]
  37. #[Assert\Type(type: 'string')]
  38. #[Assert\NotNull]
  39. #[Assert\Choice(callback: ['\AppBundle\Enum\Organization\SubFamillyTypeEnum', 'toArray'])]
  40. #[Groups(['activitytype', 'activity_reference_activitytype', 'network_list_activities'])]
  41. private $subFamillyType;
  42. /**
  43. * Sets id.
  44. *
  45. * @param int $id
  46. *
  47. * @return $this
  48. */
  49. public function setId($id)
  50. {
  51. $this->id = $id;
  52. return $this;
  53. }
  54. /**
  55. * Gets id.
  56. *
  57. * @return int
  58. */
  59. public function getId()
  60. {
  61. return $this->id;
  62. }
  63. /**
  64. * Set famillyType
  65. *
  66. * @param string $famillyType
  67. *
  68. * @return ActivityType
  69. */
  70. public function setFamillyType($famillyType)
  71. {
  72. $this->famillyType = $famillyType;
  73. return $this;
  74. }
  75. /**
  76. * Get famillyType
  77. *
  78. * @return string
  79. */
  80. public function getFamillyType()
  81. {
  82. return $this->famillyType;
  83. }
  84. /**
  85. * Set subFamillyType
  86. *
  87. * @param string $subFamillyType
  88. *
  89. * @return ActivityType
  90. */
  91. public function setSubFamillyType($subFamillyType)
  92. {
  93. $this->subFamillyType = $subFamillyType;
  94. return $this;
  95. }
  96. /**
  97. * Get subFamillyType
  98. *
  99. * @return string
  100. */
  101. public function getSubFamillyType()
  102. {
  103. return $this->subFamillyType;
  104. }
  105. }