src/Entity/Address.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AddressRepository;use Doctrine\ORM\Mapping as ORM;
  4. #[ORM\Entity(repositoryClassAddressRepository::class)]
  5. class Address
  6. {
  7.     #[ORM\Id]
  8.     #[ORM\GeneratedValue]
  9.     #[ORM\Column]
  10.     private ?int $id null;
  11.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'addresses')]
  12.     #[ORM\JoinColumn(nullablefalse)]
  13.     private ?User $user null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $label null// Exemple: "Maison", "Bureau"
  16.     #[ORM\Column(length255)]
  17.     private ?string $street null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $city null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $state null;
  22.     #[ORM\Column(length20nullabletrue)]
  23.     private ?string $zipCode null;
  24.     #[ORM\Column(length100)]
  25.     private ?string $country null;
  26.     #[ORM\Column]
  27.     private bool $isDefault false;
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     /**
  33.      * @return User|null
  34.      */
  35.     public function getUser(): ?User
  36.     {
  37.         return $this->user;
  38.     }
  39.     /**
  40.      * @param User|null $user
  41.      */
  42.     public function setUser(?User $user): void
  43.     {
  44.         $this->user $user;
  45.     }
  46.     /**
  47.      * @return string|null
  48.      */
  49.     public function getLabel(): ?string
  50.     {
  51.         return $this->label;
  52.     }
  53.     /**
  54.      * @param string|null $label
  55.      */
  56.     public function setLabel(?string $label): void
  57.     {
  58.         $this->label $label;
  59.     }
  60.     /**
  61.      * @return string|null
  62.      */
  63.     public function getStreet(): ?string
  64.     {
  65.         return $this->street;
  66.     }
  67.     /**
  68.      * @param string|null $street
  69.      */
  70.     public function setStreet(?string $street): void
  71.     {
  72.         $this->street $street;
  73.     }
  74.     /**
  75.      * @return string|null
  76.      */
  77.     public function getCity(): ?string
  78.     {
  79.         return $this->city;
  80.     }
  81.     /**
  82.      * @param string|null $city
  83.      */
  84.     public function setCity(?string $city): void
  85.     {
  86.         $this->city $city;
  87.     }
  88.     /**
  89.      * @return string|null
  90.      */
  91.     public function getState(): ?string
  92.     {
  93.         return $this->state;
  94.     }
  95.     /**
  96.      * @param string|null $state
  97.      */
  98.     public function setState(?string $state): void
  99.     {
  100.         $this->state $state;
  101.     }
  102.     /**
  103.      * @return string|null
  104.      */
  105.     public function getZipCode(): ?string
  106.     {
  107.         return $this->zipCode;
  108.     }
  109.     /**
  110.      * @param string|null $zipCode
  111.      */
  112.     public function setZipCode(?string $zipCode): void
  113.     {
  114.         $this->zipCode $zipCode;
  115.     }
  116.     /**
  117.      * @return string|null
  118.      */
  119.     public function getCountry(): ?string
  120.     {
  121.         return $this->country;
  122.     }
  123.     /**
  124.      * @param string|null $country
  125.      */
  126.     public function setCountry(?string $country): void
  127.     {
  128.         $this->country $country;
  129.     }
  130.     /**
  131.      * @return bool
  132.      */
  133.     public function isDefault(): bool
  134.     {
  135.         return $this->isDefault;
  136.     }
  137.     /**
  138.      * @param bool $isDefault
  139.      */
  140.     public function setIsDefault(bool $isDefault): void
  141.     {
  142.         $this->isDefault $isDefault;
  143.     }
  144. }