OrganizationProfile.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\ApiResources\Profile;
  4. use ApiPlatform\Core\Annotation\ApiProperty;
  5. use App\ApiResources\ApiResourcesInterface;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use ApiPlatform\Core\Annotation\ApiResource;
  8. /**
  9. * Classe resource qui contient les champs relatifs aux organizations présentent dans la requete my_profile.
  10. */
  11. #[ApiResource(
  12. collectionOperations:[],
  13. itemOperations: [
  14. 'get'
  15. ]
  16. )]
  17. class OrganizationProfile implements ApiResourcesInterface
  18. {
  19. #[ApiProperty(identifier: true)]
  20. #[Groups('access_profile_read')]
  21. public ?int $id = null;
  22. #[Groups('access_profile_read')]
  23. private ?string $name = null;
  24. #[Groups('access_profile_read')]
  25. private ?string $product = null;
  26. #[Groups('access_profile_read')]
  27. private ?string $subDomain = null;
  28. #[Groups('access_profile_read')]
  29. private array $networks = [];
  30. #[Groups('access_profile_read')]
  31. private ?string $website = null;
  32. #[Groups('access_profile_read')]
  33. private ?array $modules = [];
  34. #[Groups('access_profile_read')]
  35. private bool $hasChildren = false;
  36. #[Groups('access_profile_read')]
  37. private ?array $parents = [];
  38. #[Groups('access_profile_read')]
  39. private bool $showAdherentList = false;
  40. #[Groups('access_profile_read')]
  41. private ?int $currentYear = null;
  42. public function getId(): ?int
  43. {
  44. return $this->id;
  45. }
  46. public function setId(?int $id): self
  47. {
  48. $this->id = $id;
  49. return $this;
  50. }
  51. public function getName(): ?string
  52. {
  53. return $this->name;
  54. }
  55. public function setName(?string $name): self
  56. {
  57. $this->name = $name;
  58. return $this;
  59. }
  60. public function getProduct(): ?string
  61. {
  62. return $this->product;
  63. }
  64. public function setProduct(?string $product): self
  65. {
  66. $this->product = $product;
  67. return $this;
  68. }
  69. public function getNetworks(): array
  70. {
  71. return $this->networks;
  72. }
  73. public function addNetwork(?string $network): self
  74. {
  75. $this->networks[] = $network;
  76. return $this;
  77. }
  78. public function getSubDomain(): ?string
  79. {
  80. return $this->subDomain;
  81. }
  82. public function setSubDomain(?string $subDomain): self
  83. {
  84. $this->subDomain = $subDomain;
  85. return $this;
  86. }
  87. public function getWebsite(): ?string
  88. {
  89. return $this->website;
  90. }
  91. public function setWebsite(?string $website): self
  92. {
  93. $this->website = $website;
  94. return $this;
  95. }
  96. public function getModules(): array
  97. {
  98. $modules = $this->modules;
  99. return array_unique($modules);
  100. }
  101. public function setModules(array $modules): self
  102. {
  103. $this->modules = $modules;
  104. return $this;
  105. }
  106. public function getHasChildren(): bool
  107. {
  108. return $this->hasChildren;
  109. }
  110. public function setHasChildren(bool $hasChildren): self
  111. {
  112. $this->hasChildren = $hasChildren;
  113. return $this;
  114. }
  115. public function getParents(): array
  116. {
  117. return $this->parents;
  118. }
  119. public function addParent(OrganizationProfile $parent): self
  120. {
  121. $this->parents[] = $parent;
  122. return $this;
  123. }
  124. public function getShowAdherentList(): bool
  125. {
  126. return $this->showAdherentList;
  127. }
  128. public function setShowAdherentList(bool $showAdherentList): self
  129. {
  130. $this->showAdherentList = $showAdherentList;
  131. return $this;
  132. }
  133. public function getCurrentYear(): ?int
  134. {
  135. return $this->currentYear;
  136. }
  137. public function setCurrentYear(?int $currentYear): self
  138. {
  139. $this->currentYear = $currentYear;
  140. return $this;
  141. }
  142. }