| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <?php
- namespace App\ApiResources\Organization;
- use App\Enum\Person\GenderEnum;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * Requête de création d'un nouvel access
- */
- class OrganizationMemberCreationRequest
- {
- private GenderEnum $gender;
- #[Assert\Regex(pattern: '/^[a-z0-9\-]{3,}$/')]
- private string $username;
- #[Assert\Length(
- min: 1,
- minMessage: 'Name must be at least {{ limit }} characters long',
- )]
- private string $name;
- #[Assert\Length(
- min: 1,
- minMessage: 'Given name must be at least {{ limit }} characters long',
- )]
- private string $givenName;
- #[Assert\Length(
- min: 1,
- minMessage: 'Street address must be at least {{ limit }} characters long',
- )]
- private string $streetAddress1;
- private ?string $streetAddress2 = null;
- private ?string $streetAddress3 = null;
- #[Assert\Length(
- min: 3,
- minMessage: 'Postal code must be at least {{ limit }} characters long',
- )]
- private string $postalCode;
- #[Assert\Length(
- min: 1,
- minMessage: 'City must be at least {{ limit }} characters long',
- )]
- private string $city;
- private int $countryId = 72; // France's id
- #[Assert\Length(
- min: 10,
- minMessage: 'Phone number must be at least {{ limit }} characters long',
- )]
- private string $phone;
- #[Assert\Length(
- min: 10,
- minMessage: 'Mobile phone number must be at least {{ limit }} characters long',
- )]
- private ?string $mobile = null;
- #[Assert\Email(
- message: 'The email {{ value }} is not a valid email.',
- )]
- private string $email;
- private ?\DateTimeInterface $creationDate = null;
- private ?int $authorId = null;
- public function getUsername(): string
- {
- return $this->username;
- }
- public function setUsername(string $username): self
- {
- $this->username = $username;
- return $this;
- }
- public function getGender(): GenderEnum
- {
- return $this->gender;
- }
- public function setGender(GenderEnum $gender): self
- {
- $this->gender = $gender;
- return $this;
- }
- public function getName(): string
- {
- return $this->name;
- }
- public function setName(string $name): self
- {
- $this->name = $name;
- return $this;
- }
- public function getGivenName(): string
- {
- return $this->givenName;
- }
- public function setGivenName(string $givenName): self
- {
- $this->givenName = $givenName;
- return $this;
- }
- public function getStreetAddress1(): string
- {
- return $this->streetAddress1;
- }
- public function setStreetAddress1(string $streetAddress1): self
- {
- $this->streetAddress1 = $streetAddress1;
- return $this;
- }
- public function getStreetAddress2(): ?string
- {
- return $this->streetAddress2;
- }
- public function setStreetAddress2(?string $streetAddress2): self
- {
- $this->streetAddress2 = $streetAddress2;
- return $this;
- }
- public function getStreetAddress3(): ?string
- {
- return $this->streetAddress3;
- }
- public function setStreetAddress3(?string $streetAddress3): self
- {
- $this->streetAddress3 = $streetAddress3;
- return $this;
- }
- public function getPostalCode(): string
- {
- return $this->postalCode;
- }
- public function setPostalCode(string $postalCode): self
- {
- $this->postalCode = $postalCode;
- return $this;
- }
- public function getCity(): string
- {
- return $this->city;
- }
- public function setCity(string $city): self
- {
- $this->city = $city;
- return $this;
- }
- public function getCountryId(): int
- {
- return $this->countryId;
- }
- public function setCountryId(int $countryId): self
- {
- $this->countryId = $countryId;
- return $this;
- }
- public function getPhone(): string
- {
- return $this->phone;
- }
- public function setPhone(string $phone): self
- {
- $this->phone = $phone;
- return $this;
- }
- public function getMobile(): ?string
- {
- return $this->mobile;
- }
- public function setMobile(?string $mobile): self
- {
- $this->mobile = $mobile;
- return $this;
- }
- public function getEmail(): string
- {
- return $this->email;
- }
- public function setEmail(string $email): self
- {
- $this->email = $email;
- return $this;
- }
- public function getCreationDate(): ?\DateTimeInterface
- {
- return $this->creationDate;
- }
- public function setCreationDate(?\DateTimeInterface $creationDate): self
- {
- $this->creationDate = $creationDate;
- return $this;
- }
- public function getAuthorId(): ?int
- {
- return $this->authorId;
- }
- public function setAuthorId(?int $authorId): self
- {
- $this->authorId = $authorId;
- return $this;
- }
- }
|