<?php
namespace App\Entity;
use App\Repository\ReservationsRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ReservationsRepository::class)
*/
class Reservations
{
const MR="M";
const MME="Mme";
const DOMICILE = "Livraison à domicile";
const AUGARAGE = "Au garage";
const CIVILITE = [self::MR=>1,self::MME=>2];
const LIVRAISON = [self::DOMICILE=>1,self::AUGARAGE=>2];
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="integer")
*/
private $civilite;
/**
* @ORM\Column(type="string", length=255)
*/
private $prenom;
/**
* @ORM\Column(type="string", length=255)
*/
private $nom;
/**
* @ORM\Column(type="string", length=255)
*/
private $adresse;
/**
* @ORM\Column(type="integer")
*/
private $codePostal;
/**
* @ORM\Column(type="string", length=255)
*/
private $email;
/**
* @ORM\Column(type="string")
*/
private $tel;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Voiture", inversedBy="reservations")
* @ORM\JoinColumn(nullable=false)
*/
private $voiture;
/**
* @ORM\Column(type="boolean")
*/
private $livraison;
/**
* @ORM\Column(type="float")
*/
private $acompte;
public function __toString()
{
return $this->getNom() . " - " .$this->getPrenom();
}
public function getId(): ?int
{
return $this->id;
}
public function getCivilite(): ?int
{
return $this->civilite;
}
public function setCivilite(int $civilite): self
{
$this->civilite = $civilite;
return $this;
}
public function getPrenom(): ?string
{
return $this->prenom;
}
public function setPrenom(string $prenom): self
{
$this->prenom = $prenom;
return $this;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getCodePostal(): ?int
{
return $this->codePostal;
}
public function setCodePostal(int $codePostal): self
{
$this->codePostal = $codePostal;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getTel(): ?string
{
return $this->tel;
}
public function setTel(string $tel): self
{
$this->tel = $tel;
return $this;
}
public function isLivraison(): ?bool
{
return $this->livraison;
}
public function setLivraison(bool $livraison): self
{
$this->livraison = $livraison;
return $this;
}
public function getAcompte(): ?float
{
return $this->acompte;
}
public function setAcompte(float $acompte): self
{
$this->acompte = $acompte;
return $this;
}
public function getVoiture(): ?Voiture
{
return $this->voiture;
}
public function setVoiture(?Voiture $voiture): self
{
$this->voiture = $voiture;
return $this;
}
}