OrganizationProfile.php 3.3 KB

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