OrganizationProfile.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\ApiResources\Profile;
  4. use ApiPlatform\Core\Annotation\ApiProperty;
  5. /**
  6. * Classe resource qui contient les champs relatifs aux organizations présentent dans la requete my_profile.
  7. * @package App\ApiResources\Profile
  8. */
  9. class OrganizationProfile
  10. {
  11. /**
  12. * @ApiProperty(identifier=true)
  13. */
  14. public int $id;
  15. private string $name;
  16. private string $product;
  17. private string $subDomain;
  18. private string $website;
  19. private array $modules = [];
  20. private bool $hasChildren = false;
  21. private array $parents = [];
  22. public function __construct()
  23. {
  24. }
  25. public function getId(): ?int
  26. {
  27. return $this->id;
  28. }
  29. public function setId(?int $id): self
  30. {
  31. $this->id = $id;
  32. return $this;
  33. }
  34. public function getName(): ?string
  35. {
  36. return $this->name;
  37. }
  38. public function setName(?string $name): self
  39. {
  40. $this->name = $name;
  41. return $this;
  42. }
  43. public function getProduct(): ?string
  44. {
  45. return $this->product;
  46. }
  47. public function setProduct(?string $product): self
  48. {
  49. $this->product = $product;
  50. return $this;
  51. }
  52. public function getSubDomain(): ?string
  53. {
  54. return $this->subDomain;
  55. }
  56. public function setSubDomain(?string $subDomain): self
  57. {
  58. $this->subDomain = $subDomain;
  59. return $this;
  60. }
  61. public function getWebsite(): ?string
  62. {
  63. return $this->website;
  64. }
  65. public function setWebsite(?string $website): self
  66. {
  67. $this->website = $website;
  68. return $this;
  69. }
  70. public function getModules(): array
  71. {
  72. $modules = $this->modules;
  73. return array_unique($modules);
  74. }
  75. public function setModules(array $modules): self
  76. {
  77. $this->modules = $modules;
  78. return $this;
  79. }
  80. public function getHasChildren(): bool
  81. {
  82. return $this->hasChildren;
  83. }
  84. public function setHasChildren(bool $hasChildren): self
  85. {
  86. $this->hasChildren = $hasChildren;
  87. return $this;
  88. }
  89. public function getParents(): array
  90. {
  91. return $this->parents;
  92. }
  93. public function addParent(OrganizationProfile $parent): self
  94. {
  95. $this->parents[] = $parent;
  96. return $this;
  97. }
  98. }