<?php
namespace App\Entity\Vetoadom;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Client
*
* @ORM\Table(name="client", indexes={@ORM\Index(name="FK_client_referant", columns={"referant_id"}), @ORM\Index(name="FK_client_ville", columns={"ville_id"}), @ORM\Index(name="FK_client_habitation", columns={"habitation_id"})})
* @ORM\Entity(repositoryClass="App\Repository\Vetoadom\ClientRepository")
* @ORM\HasLifecycleCallbacks()
*/
class Client
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="nom", type="string", length=190, nullable=false)
* @Assert\NotBlank(
* groups={"nom"},
* message="common.blank"
* )
* @Assert\Length(
* groups={"nom"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $nom;
/**
* @var string|null
*
* @ORM\Column(name="email", type="string", length=75, nullable=true)
* @Assert\Email(
* groups={"email"},
* message="common.email"
* )
*/
private $email;
/**
* @var string
*
* @ORM\Column(name="telephone1", type="string", length=30, nullable=false)
* @Assert\NotBlank(
* groups={"telephone1"},
* message="common.blank"
* )
* @Assert\Regex(
* groups={"telephone1"},
* pattern="/^\d{1,30}$/",
* message="common.format_wrong"
* )
*/
private $telephone1;
/**
* @var string|null
*
* @ORM\Column(name="telephone2", type="string", length=30, nullable=true)
* @Assert\Regex(
* groups={"telephone2"},
* pattern="/^\d{1,30}$/",
* message="common.format_wrong"
* )
*/
private $telephone2;
/**
* @var string|null
*
* @ORM\Column(name="adresse", type="string", length=38, nullable=true)
* @Assert\NotBlank(
* groups={"adresse"},
* message="common.blank"
* )
* @Assert\Length(
* groups={"adresse"},
* max=38,
* maxMessage="common.too_long"
* )
*/
private $adresse;
/**
* @var string|null
*
* @ORM\Column(name="complement_adresse", type="string", length=38, nullable=true)
* @Assert\Length(
* groups={"complementAdresse"},
* max=38,
* maxMessage="common.too_long"
* )
*/
private $complementAdresse;
/**
* @var string|null
*
* @ORM\Column(name="interphone", type="string", length=20, nullable=true)
* @Assert\Length(
* groups={"interphone"},
* max=20,
* maxMessage="common.too_long"
* )
*/
private $interphone;
/**
* @var string|null
*
* @ORM\Column(name="code", type="string", length=20, nullable=true)
* @Assert\Length(
* groups={"code"},
* max=20,
* maxMessage="common.too_long"
* )
*/
private $code;
/**
* @var string|null
*
* @ORM\Column(name="batiment", type="string", length=20, nullable=true)
* @Assert\Length(
* groups={"batiment"},
* max=20,
* maxMessage="common.too_long"
* )
*/
private $batiment;
/**
* @var string|null
*
* @ORM\Column(name="ascenseur", type="string", length=20, nullable=true)
* @Assert\Length(
* groups={"ascenseur"},
* max=20,
* maxMessage="common.too_long"
* )
*/
private $ascenseur;
/**
* @var string|null
*
* @ORM\Column(name="escalier", type="string", length=20, nullable=true)
* @Assert\Length(
* groups={"escalier"},
* max=20,
* maxMessage="common.too_long"
* )
*/
private $escalier;
/**
* @var string|null
*
* @ORM\Column(name="etage", type="string", length=20, nullable=true)
* @Assert\Length(
* groups={"etage"},
* max=20,
* maxMessage="common.too_long"
* )
*/
private $etage;
/**
* @var string|null
*
* @ORM\Column(name="appartement", type="string", length=20, nullable=true)
* @Assert\Length(
* groups={"appartement"},
* max=20,
* maxMessage="common.too_long"
* )
*/
private $appartement;
/**
* @var string|null
*
* @ORM\Column(name="informations_complementaires", type="text", length=65535, nullable=true)
* @Assert\Length(
* groups={"informationsComplementaires"},
* max=65535,
* maxMessage="common.too_long"
* )
*/
private $informationsComplementaires;
/**
* @var string|null
*
* @ORM\Column(name="informations_particulier", type="text", length=65535, nullable=true)
* @Assert\Length(
* groups={"informationsParticulier"},
* max=65535,
* maxMessage="common.too_long"
* )
*/
private $informationsParticulier;
/**
* @var \DateTime|null
*
* @ORM\Column(name="info_part_date_modification", type="datetime", nullable=true)
*/
private $infoPartDateModification;
/**
* @var \DateTime
*
* @ORM\Column(name="date_creation", type="datetime", nullable=false)
*/
private $dateCreation;
/**
* @var \DateTime
*
* @ORM\Column(name="date_modification", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"})
*/
private $dateModification;
/**
* @var \DateTime|null
*
* @ORM\Column(name="date_suppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @var bool
*
* @ORM\Column(name="active", type="boolean", nullable=false, options={"default"="1"})
*/
private $active = true;
/**
* @var \Habitation
*
* @ORM\ManyToOne(targetEntity="Habitation")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="habitation_id", referencedColumnName="id")
* })
* @Assert\NotBlank(
* groups={"habitation"},
* message="common.blank"
* )
*/
private $habitation;
/**
* @var \Referant
*
* @ORM\ManyToOne(targetEntity="Referant")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="referant_id", referencedColumnName="id")
* })
* @Assert\NotBlank(
* groups={"referant"},
* message="common.blank"
* )
*/
private $referant;
/**
* @var \Ville
*
* @ORM\ManyToOne(targetEntity="Ville")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="ville_id", referencedColumnName="id")
* })
* @Assert\NotBlank(
* groups={"ville"},
* message="common.blank"
* )
*/
private $ville;
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
if ($email === '') $email = null;
$this->email = $email;
return $this;
}
public function getTelephone1(): ?string
{
return $this->telephone1;
}
public function setTelephone1(string $telephone1): self
{
$this->telephone1 = $telephone1;
return $this;
}
public function getTelephone2(): ?string
{
return $this->telephone2;
}
public function setTelephone2(?string $telephone2): self
{
if ($telephone2 === '') $telephone2 = null;
$this->telephone2 = $telephone2;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
if ($adresse === '') $adresse = null;
$this->adresse = $adresse;
return $this;
}
public function getComplementAdresse(): ?string
{
return $this->complementAdresse;
}
public function setComplementAdresse(?string $complementAdresse): self
{
if ($complementAdresse === '') $complementAdresse = null;
$this->complementAdresse = $complementAdresse;
return $this;
}
public function getInterphone(): ?string
{
return $this->interphone;
}
public function setInterphone(?string $interphone): self
{
if ($interphone === '') $interphone = null;
$this->interphone = $interphone;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(?string $code): self
{
if ($code === '') $code = null;
$this->code = $code;
return $this;
}
public function getBatiment(): ?string
{
return $this->batiment;
}
public function setBatiment(?string $batiment): self
{
if ($batiment === '') $batiment = null;
$this->batiment = $batiment;
return $this;
}
public function getAscenseur(): ?string
{
return $this->ascenseur;
}
public function setAscenseur(?string $ascenseur): self
{
if ($ascenseur === '') $ascenseur = null;
$this->ascenseur = $ascenseur;
return $this;
}
public function getEscalier(): ?string
{
return $this->escalier;
}
public function setEscalier(?string $escalier): self
{
if ($escalier === '') $escalier = null;
$this->escalier = $escalier;
return $this;
}
public function getEtage(): ?string
{
return $this->etage;
}
public function setEtage(?string $etage): self
{
if ($etage === '') $etage = null;
$this->etage = $etage;
return $this;
}
public function getAppartement(): ?string
{
return $this->appartement;
}
public function setAppartement(?string $appartement): self
{
if ($appartement === '') $appartement = null;
$this->appartement = $appartement;
return $this;
}
public function getInformationsComplementaires(): ?string
{
return $this->informationsComplementaires;
}
public function setInformationsComplementaires(?string $informationsComplementaires): self
{
if ($informationsComplementaires === '') $informationsComplementaires = null;
$this->informationsComplementaires = $informationsComplementaires;
return $this;
}
public function getInformationsParticulier(): ?string
{
return $this->informationsParticulier;
}
public function setInformationsParticulier(?string $informationsParticulier): self
{
$oldValue = $this->informationsParticulier;
if ($informationsParticulier === '') $informationsParticulier = null;
$this->informationsParticulier = $informationsParticulier;
if ($oldValue !== $this->informationsParticulier) {
$this->setInfoPartDateModification(new \DateTime());
}
return $this;
}
public function getInfoPartDateModification(): ?\DateTimeInterface
{
return $this->infoPartDateModification;
}
public function setInfoPartDateModification(?\DateTimeInterface $infoPartDateModification): self
{
$this->infoPartDateModification = $infoPartDateModification;
return $this;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->dateCreation;
}
public function setDateCreation(\DateTimeInterface $dateCreation): self
{
$this->dateCreation = $dateCreation;
return $this;
}
public function getDateModification(): ?\DateTimeInterface
{
return $this->dateModification;
}
public function setDateModification(\DateTimeInterface $dateModification): self
{
$this->dateModification = $dateModification;
return $this;
}
public function getDateSuppression(): ?\DateTimeInterface
{
return $this->dateSuppression;
}
public function setDateSuppression(?\DateTimeInterface $dateSuppression): self
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
public function getHabitation(): ?Habitation
{
return $this->habitation;
}
public function setHabitation(?Habitation $habitation): self
{
$this->habitation = $habitation;
return $this;
}
public function getReferant(): ?Referant
{
return $this->referant;
}
public function setReferant(?Referant $referant): self
{
$this->referant = $referant;
return $this;
}
public function getVille(): ?Ville
{
return $this->ville;
}
public function setVille(?Ville $ville): self
{
$this->ville = $ville;
return $this;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAtValue()
{
$this->dateCreation = new \DateTimeImmutable();
}
}