OrganizationProfile.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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 $legalStatus = 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. #[Groups('access_profile_read')]
  43. private ?int $parametersId = null;
  44. public function getId(): ?int
  45. {
  46. return $this->id;
  47. }
  48. public function setId(?int $id): self
  49. {
  50. $this->id = $id;
  51. return $this;
  52. }
  53. public function getName(): ?string
  54. {
  55. return $this->name;
  56. }
  57. public function setName(?string $name): self
  58. {
  59. $this->name = $name;
  60. return $this;
  61. }
  62. public function getProduct(): ?string
  63. {
  64. return $this->product;
  65. }
  66. public function setProduct(?string $product): self
  67. {
  68. $this->product = $product;
  69. return $this;
  70. }
  71. public function getLegalStatus(): ?string
  72. {
  73. return $this->legalStatus;
  74. }
  75. public function setLegalStatus(?string $legalStatus): self
  76. {
  77. $this->legalStatus = $legalStatus;
  78. return $this;
  79. }
  80. public function getNetworks(): array
  81. {
  82. return $this->networks;
  83. }
  84. public function addNetwork(?string $network): self
  85. {
  86. $this->networks[] = $network;
  87. return $this;
  88. }
  89. public function getWebsite(): ?string
  90. {
  91. return $this->website;
  92. }
  93. public function setWebsite(?string $website): self
  94. {
  95. $this->website = $website;
  96. return $this;
  97. }
  98. public function getModules(): array
  99. {
  100. $modules = $this->modules;
  101. return array_unique($modules);
  102. }
  103. public function setModules(array $modules): self
  104. {
  105. $this->modules = $modules;
  106. return $this;
  107. }
  108. public function getHasChildren(): bool
  109. {
  110. return $this->hasChildren;
  111. }
  112. public function setHasChildren(bool $hasChildren): self
  113. {
  114. $this->hasChildren = $hasChildren;
  115. return $this;
  116. }
  117. public function getParents(): array
  118. {
  119. return $this->parents;
  120. }
  121. public function addParent(OrganizationProfile $parent): self
  122. {
  123. $this->parents[] = $parent;
  124. return $this;
  125. }
  126. public function getShowAdherentList(): bool
  127. {
  128. return $this->showAdherentList;
  129. }
  130. public function setShowAdherentList(bool $showAdherentList): self
  131. {
  132. $this->showAdherentList = $showAdherentList;
  133. return $this;
  134. }
  135. public function getCurrentYear(): ?int
  136. {
  137. return $this->currentYear;
  138. }
  139. public function setCurrentYear(?int $currentYear): self
  140. {
  141. $this->currentYear = $currentYear;
  142. return $this;
  143. }
  144. public function getParametersId(): ?int
  145. {
  146. return $this->parametersId;
  147. }
  148. public function setParametersId(?int $parametersId): self
  149. {
  150. $this->parametersId = $parametersId;
  151. return $this;
  152. }
  153. }