<?php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
use App\Repository\AdresseRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AdresseRepository::class)
*/
class Adresse
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $lastName;
/**
* @ORM\Column(type="string", length=255)
*/
private $firstName;
/**
* @Assert\NotBlank()
* @ORM\Column(type="string", length=255 , nullable=true)
*/
private $city;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $codePostal;
/**
* @ORM\Column(type="string", length=255)
*/
private $tel;
/**
* @Assert\NotBlank()
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $rue;
/**
* @ORM\OneToOne(targetEntity=User::class, mappedBy="adresse", cascade={"persist", "remove"})
*/
private $user;
/**
* @Assert\NotBlank()
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $pays;
public function getId(): ?int
{
return $this->id;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(string $city): self
{
$this->city = $city;
return $this;
}
public function getCodePostal(): ?string
{
return $this->codePostal;
}
public function setCodePostal(?string $codePostal): self
{
$this->codePostal = $codePostal;
return $this;
}
public function getTel(): ?string
{
return $this->tel;
}
public function setTel(string $tel): self
{
$this->tel = $tel;
return $this;
}
public function getRue(): ?string
{
return $this->rue;
}
public function setRue(?string $rue): self
{
$this->rue = $rue;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
// unset the owning side of the relation if necessary
if ($user === null && $this->user !== null) {
$this->user->setAdresse(null);
}
// set the owning side of the relation if necessary
if ($user !== null && $user->getAdresse() !== $this) {
$user->setAdresse($this);
}
$this->user = $user;
return $this;
}
public function getPays(): ?string
{
return $this->pays;
}
public function setPays(string $pays): self
{
$this->pays = $pays;
return $this;
}
}