<?php
namespace App\Entity;
use App\Repository\UserAddressRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: UserAddressRepository::class)]
class UserAddress
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $street;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $city;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $state;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $postcode;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $country;
#[ORM\OneToOne(inversedBy: 'userAddress', targetEntity: User::class, cascade: ['persist', 'remove'])]
private $user;
public function getId(): ?int
{
return $this->id;
}
public function getStreet(): ?string
{
return $this->street;
}
public function setStreet(?string $street): self
{
$this->street = $street;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): self
{
$this->state = $state;
return $this;
}
public function getPostcode(): ?string
{
return $this->postcode;
}
public function setPostcode(?string $postcode): self
{
$this->postcode = $postcode;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): self
{
$this->country = $country;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
}