OrganizationProfile.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 $id;
  15. private $name;
  16. private $product;
  17. private $subDomain;
  18. private $networks = [];
  19. private $website;
  20. private $modules = [];
  21. private $hasChildren = false;
  22. private $parents = [];
  23. public function __construct()
  24. {
  25. }
  26. public function getId(): ?int
  27. {
  28. return $this->id;
  29. }
  30. public function setId(?int $id): self
  31. {
  32. $this->id = $id;
  33. return $this;
  34. }
  35. public function getName(): ?string
  36. {
  37. return $this->name;
  38. }
  39. public function setName(?string $name): self
  40. {
  41. $this->name = $name;
  42. return $this;
  43. }
  44. public function getProduct(): ?string
  45. {
  46. return $this->product;
  47. }
  48. public function setProduct(?string $product): self
  49. {
  50. $this->product = $product;
  51. return $this;
  52. }
  53. public function getNetworks(): array
  54. {
  55. return $this->networks;
  56. }
  57. public function addNetwork(?string $network): self
  58. {
  59. $this->networks[] = $network;
  60. return $this;
  61. }
  62. public function getSubDomain(): ?string
  63. {
  64. return $this->subDomain;
  65. }
  66. public function setSubDomain(?string $subDomain): self
  67. {
  68. $this->subDomain = $subDomain;
  69. return $this;
  70. }
  71. public function getWebsite(): ?string
  72. {
  73. return $this->website;
  74. }
  75. public function setWebsite(?string $website): self
  76. {
  77. $this->website = $website;
  78. return $this;
  79. }
  80. public function getModules(): array
  81. {
  82. $modules = $this->modules;
  83. return array_unique($modules);
  84. }
  85. public function setModules(array $modules): self
  86. {
  87. $this->modules = $modules;
  88. return $this;
  89. }
  90. public function getHasChildren(): bool
  91. {
  92. return $this->hasChildren;
  93. }
  94. public function setHasChildren(bool $hasChildren): self
  95. {
  96. $this->hasChildren = $hasChildren;
  97. return $this;
  98. }
  99. public function getParents(): array
  100. {
  101. return $this->parents;
  102. }
  103. public function addParent(OrganizationProfile $parent): self
  104. {
  105. $this->parents[] = $parent;
  106. return $this;
  107. }
  108. }