<?php
namespace App\Entity;
use App\Repository\AddressRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AddressRepository::class)]
class Address
{
public const TYPE_NONE = 'none';
public const TYPE_DELIVERY = 'delivery';
public const TYPE_BILLING = 'billing';
public const BOTH = 'both';
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $city = null;
#[ORM\Column(length: 255)]
private ?string $postCode = null;
#[ORM\Column(length: 255)]
private ?string $address = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $complement = null;
#[ORM\Column(length: 255)]
private ?string $type = Address::TYPE_NONE;
#[ORM\Column(length: 255)]
private ?string $label = null;
#[ORM\ManyToOne(inversedBy: 'addresses')]
#[ORM\JoinColumn(nullable: false)]
private ?User $user = null;
public function getId(): ?int
{
return $this->id;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(string $city): self
{
$this->city = $city;
return $this;
}
public function getPostCode(): ?string
{
return $this->postCode;
}
public function setPostCode(string $postCode): self
{
$this->postCode = $postCode;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
return $this;
}
public function getComplement(): ?string
{
return $this->complement;
}
public function setComplement(?string $complement): self
{
$this->complement = $complement;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
}