src/Order/Doctrine/Entity/Address.php line 15

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Order\Doctrine\Entity;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping\Column;
  6. use Doctrine\ORM\Mapping\Embeddable;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use Symfony\Component\Validator\Constraints\Email;
  9. use Symfony\Component\Validator\Constraints\NotBlank;
  10. #[Embeddable]
  11. class Address
  12. {
  13.     #[Groups(['read''write'])]
  14.     #[Column(typeTypes::STRING)]
  15.     #[NotBlank(message'Veuillez renseigner une adresse.')]
  16.     private string $address;
  17.     #[Groups(['read''write'])]
  18.     #[Column(typeTypes::TEXTnullabletrue)]
  19.     private ?string $restAddress null;
  20.     #[Groups(['read''write'])]
  21.     #[Column(typeTypes::STRING)]
  22.     #[NotBlank(message'Veuillez renseigner un code postal.')]
  23.     private string $zipCode;
  24.     #[Groups(['read''write'])]
  25.     #[Column(typeTypes::STRING)]
  26.     #[NotBlank(message'Veuillez renseigner une ville.')]
  27.     private string $city;
  28.     #[Groups(['read''write'])]
  29.     #[Column(typeTypes::STRING)]
  30.     #[NotBlank(message'Veuillez renseigner un pays.')]
  31.     private string $country;
  32.     #[Groups(['read''write'])]
  33.     #[Column(typeTypes::BOOLEAN)]
  34.     private bool $professional true;
  35.     #[Groups(['read''write'])]
  36.     #[Column(typeTypes::STRINGnullabletrue)]
  37.     private ?string $companyName null;
  38.     #[Groups(['read''write'])]
  39.     #[Column(typeTypes::STRING)]
  40.     #[NotBlank(message'Veuillez renseigner un prénom.')]
  41.     private string $firstName;
  42.     #[Groups(['read''write'])]
  43.     #[Column(typeTypes::STRING)]
  44.     #[NotBlank(message'Veuillez renseigner un nom.')]
  45.     private string $lastName;
  46.     #[Groups(['read''write'])]
  47.     #[Column(typeTypes::STRING)]
  48.     #[NotBlank(message'Veuillez renseigner un numéro de téléphone.')]
  49.     private string $phone;
  50.     #[Groups(['read''write'])]
  51.     #[Column(typeTypes::STRING)]
  52.     #[NotBlank(message'Veuillez renseigner une adresse email.')]
  53.     #[Email]
  54.     private string $email;
  55.     /**
  56.      * @var array<array-key, string>
  57.      */
  58.     #[Column(typeTypes::JSONoptions: ['collation' => 'utf8mb4_bin'])]
  59.     #[Groups(['read''write'])]
  60.     private array $copyEmails = [];
  61.     /**
  62.      * @var array<array-key, string>
  63.      */
  64.     #[Column(typeTypes::JSONoptions: ['collation' => 'utf8mb4_bin'])]
  65.     #[Groups(['read''write'])]
  66.     private array $blindCopyEmails = [];
  67.     public function getAddress(): string
  68.     {
  69.         return $this->address;
  70.     }
  71.     public function setAddress(string $address): void
  72.     {
  73.         $this->address $address;
  74.     }
  75.     public function getRestAddress(): ?string
  76.     {
  77.         return $this->restAddress;
  78.     }
  79.     public function setRestAddress(?string $restAddress): void
  80.     {
  81.         $this->restAddress $restAddress;
  82.     }
  83.     public function getZipCode(): string
  84.     {
  85.         return $this->zipCode;
  86.     }
  87.     public function setZipCode(string $zipCode): void
  88.     {
  89.         $this->zipCode $zipCode;
  90.     }
  91.     public function getCity(): string
  92.     {
  93.         return $this->city;
  94.     }
  95.     public function setCity(string $city): void
  96.     {
  97.         $this->city $city;
  98.     }
  99.     public function getCountry(): string
  100.     {
  101.         return $this->country;
  102.     }
  103.     public function setCountry(string $country): void
  104.     {
  105.         $this->country $country;
  106.     }
  107.     public function getFirstName(): string
  108.     {
  109.         return $this->firstName;
  110.     }
  111.     public function setFirstName(string $firstName): void
  112.     {
  113.         $this->firstName $firstName;
  114.     }
  115.     public function getLastName(): string
  116.     {
  117.         return $this->lastName;
  118.     }
  119.     public function setLastName(string $lastName): void
  120.     {
  121.         $this->lastName $lastName;
  122.     }
  123.     public function getPhone(): string
  124.     {
  125.         return $this->phone;
  126.     }
  127.     public function setPhone(string $phone): void
  128.     {
  129.         $this->phone $phone;
  130.     }
  131.     public function getEmail(): string
  132.     {
  133.         return $this->email;
  134.     }
  135.     public function setEmail(string $email): void
  136.     {
  137.         $this->email $email;
  138.     }
  139.     public function getCopyEmails(): array
  140.     {
  141.         return $this->copyEmails;
  142.     }
  143.     public function setCopyEmails(array $copyEmails): void
  144.     {
  145.         $this->copyEmails $copyEmails;
  146.     }
  147.     public function getBlindCopyEmails(): array
  148.     {
  149.         return $this->blindCopyEmails;
  150.     }
  151.     public function setBlindCopyEmails(array $blindCopyEmails): void
  152.     {
  153.         $this->blindCopyEmails $blindCopyEmails;
  154.     }
  155.     public function isProfessional(): bool
  156.     {
  157.         return $this->professional;
  158.     }
  159.     public function setProfessional(bool $professional): void
  160.     {
  161.         $this->professional $professional;
  162.     }
  163.     public function getCompanyName(): ?string
  164.     {
  165.         return $this->companyName;
  166.     }
  167.     public function setCompanyName(?string $companyName): void
  168.     {
  169.         $this->companyName $companyName;
  170.     }
  171.     public function getFullName(): string
  172.     {
  173.         return $this->firstName ' ' $this->lastName;
  174.     }
  175. }