| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- <?php
- declare(strict_types=1);
- namespace App\ApiResources\Profile;
- use ApiPlatform\Metadata\ApiProperty;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\Get;
- use App\ApiResources\ApiResourcesInterface;
- use App\Enum\Organization\LegalEnum;
- use App\Enum\Organization\PrincipalTypeEnum;
- use App\Enum\Organization\SettingsProductEnum;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * Classe resource qui contient les champs relatifs aux organizations présentent dans la requete my_profile.
- */
- #[ApiResource(
- operations: [
- new Get(),
- ]
- )]
- class OrganizationProfile implements ApiResourcesInterface
- {
- #[ApiProperty(identifier: true)]
- #[Groups('access_profile_read')]
- public ?int $id = null;
- #[Groups('access_profile_read')]
- private ?string $name = null;
- #[Groups('access_profile_read')]
- #[Assert\Type(type: SettingsProductEnum::class)]
- private ?SettingsProductEnum $product = null;
- #[Groups('access_profile_read')]
- #[Assert\Type(type: LegalEnum::class)]
- private ?LegalEnum $legalStatus = null;
- /** @var list<string> $networks */
- #[Groups('access_profile_read')]
- private array $networks = [];
- #[Groups('access_profile_read')]
- private ?string $website = null;
- /** @var list<string> $modules */
- #[Groups('access_profile_read')]
- private array $modules = [];
- #[Groups('access_profile_read')]
- private bool $hasChildren = false;
- /** @var list<OrganizationProfile> */
- #[Groups('access_profile_read')]
- private array $parents = [];
- #[Groups('access_profile_read')]
- private bool $showAdherentList = false;
- #[Groups('access_profile_read')]
- private ?int $currentYear = null;
- #[Groups('access_profile_read')]
- private ?int $parametersId = null;
- #[Groups('access_profile_read')]
- #[Assert\Type(type: PrincipalTypeEnum::class)]
- private ?PrincipalTypeEnum $principalType = null;
- #[Groups('access_profile_read')]
- private bool $trialActive = false;
- #[Groups('access_profile_read')]
- private ?int $trialCountDown = null;
- #[Groups('access_profile_read')]
- private ?SettingsProductEnum $productBeforeTrial = null;
- public function getId(): ?int
- {
- return $this->id;
- }
- public function setId(?int $id): self
- {
- $this->id = $id;
- return $this;
- }
- public function getName(): ?string
- {
- return $this->name;
- }
- public function setName(?string $name): self
- {
- $this->name = $name;
- return $this;
- }
- public function getProduct(): ?SettingsProductEnum
- {
- return $this->product;
- }
- public function setProduct(?SettingsProductEnum $product): self
- {
- $this->product = $product;
- return $this;
- }
- public function getLegalStatus(): ?LegalEnum
- {
- return $this->legalStatus;
- }
- public function setLegalStatus(?LegalEnum $legalStatus): self
- {
- $this->legalStatus = $legalStatus;
- return $this;
- }
- /**
- * @return list<string>
- */
- public function getNetworks(): array
- {
- return $this->networks;
- }
- public function addNetwork(?string $network): self
- {
- $this->networks[] = $network;
- return $this;
- }
- public function getWebsite(): ?string
- {
- return $this->website;
- }
- public function setWebsite(?string $website): self
- {
- $this->website = $website;
- return $this;
- }
- /**
- * @return list<string>
- */
- public function getModules(): array
- {
- $modules = $this->modules;
- return array_unique($modules);
- }
- /**
- * @param list<string> $modules
- *
- * @return $this
- */
- public function setModules(array $modules): self
- {
- $this->modules = $modules;
- return $this;
- }
- public function getHasChildren(): bool
- {
- return $this->hasChildren;
- }
- public function setHasChildren(bool $hasChildren): self
- {
- $this->hasChildren = $hasChildren;
- return $this;
- }
- /**
- * @return list<OrganizationProfile>
- */
- public function getParents(): array
- {
- return $this->parents;
- }
- public function addParent(OrganizationProfile $parent): self
- {
- $this->parents[] = $parent;
- return $this;
- }
- public function getShowAdherentList(): bool
- {
- return $this->showAdherentList;
- }
- public function setShowAdherentList(bool $showAdherentList): self
- {
- $this->showAdherentList = $showAdherentList;
- return $this;
- }
- public function getCurrentYear(): ?int
- {
- return $this->currentYear;
- }
- public function setCurrentYear(?int $currentYear): self
- {
- $this->currentYear = $currentYear;
- return $this;
- }
- public function getParametersId(): ?int
- {
- return $this->parametersId;
- }
- public function setParametersId(?int $parametersId): self
- {
- $this->parametersId = $parametersId;
- return $this;
- }
- public function getPrincipalType(): ?PrincipalTypeEnum
- {
- return $this->principalType;
- }
- public function setPrincipalType(?PrincipalTypeEnum $principalType): self
- {
- $this->principalType = $principalType;
- return $this;
- }
- public function isTrialActive(): bool
- {
- return $this->trialActive;
- }
- public function setTrialActive(bool $trialActive): self
- {
- $this->trialActive = $trialActive;
- return $this;
- }
- public function getTrialCountDown(): ?int
- {
- return $this->trialCountDown;
- }
- public function setTrialCountDown(?int $trialCountDown): self
- {
- $this->trialCountDown = $trialCountDown;
- return $this;
- }
- public function getProductBeforeTrial(): ?SettingsProductEnum
- {
- return $this->productBeforeTrial;
- }
- public function setProductBeforeTrial(?SettingsProductEnum $productBeforeTrial): self
- {
- $this->productBeforeTrial = $productBeforeTrial;
- return $this;
- }
- }
|