src/Entity/Reservations.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ReservationsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=ReservationsRepository::class)
  7.  */
  8. class Reservations
  9. {
  10.     const MR="M";
  11.     const MME="Mme";
  12.     const DOMICILE "Livraison à domicile";
  13.     const AUGARAGE "Au garage";
  14.     const CIVILITE = [self::MR=>1,self::MME=>2];
  15.     const LIVRAISON = [self::DOMICILE=>1,self::AUGARAGE=>2];
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private $civilite;
  26.     /**
  27.      * @ORM\Column(type="string", length=255)
  28.      */
  29.     private $prenom;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $nom;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $adresse;
  38.     /**
  39.      * @ORM\Column(type="integer")
  40.      */
  41.     private $codePostal;
  42.     /**
  43.      * @ORM\Column(type="string", length=255)
  44.      */
  45.     private $email;
  46.     /**
  47.      * @ORM\Column(type="string")
  48.      */
  49.     private $tel;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity="App\Entity\Voiture", inversedBy="reservations")
  52.      * @ORM\JoinColumn(nullable=false)
  53.      */
  54.     private $voiture;
  55.     /**
  56.      * @ORM\Column(type="boolean")
  57.      */
  58.     private $livraison;
  59.     /**
  60.      * @ORM\Column(type="float")
  61.      */
  62.     private $acompte;
  63.     public function __toString()
  64.     {
  65.        return $this->getNom() . " - " .$this->getPrenom();
  66.     }
  67.     public function getId(): ?int
  68.     {
  69.         return $this->id;
  70.     }
  71.     public function getCivilite(): ?int
  72.     {
  73.         return $this->civilite;
  74.     }
  75.     public function setCivilite(int $civilite): self
  76.     {
  77.         $this->civilite $civilite;
  78.         return $this;
  79.     }
  80.     public function getPrenom(): ?string
  81.     {
  82.         return $this->prenom;
  83.     }
  84.     public function setPrenom(string $prenom): self
  85.     {
  86.         $this->prenom $prenom;
  87.         return $this;
  88.     }
  89.     public function getNom(): ?string
  90.     {
  91.         return $this->nom;
  92.     }
  93.     public function setNom(string $nom): self
  94.     {
  95.         $this->nom $nom;
  96.         return $this;
  97.     }
  98.     public function getAdresse(): ?string
  99.     {
  100.         return $this->adresse;
  101.     }
  102.     public function setAdresse(string $adresse): self
  103.     {
  104.         $this->adresse $adresse;
  105.         return $this;
  106.     }
  107.     public function getCodePostal(): ?int
  108.     {
  109.         return $this->codePostal;
  110.     }
  111.     public function setCodePostal(int $codePostal): self
  112.     {
  113.         $this->codePostal $codePostal;
  114.         return $this;
  115.     }
  116.     public function getEmail(): ?string
  117.     {
  118.         return $this->email;
  119.     }
  120.     public function setEmail(string $email): self
  121.     {
  122.         $this->email $email;
  123.         return $this;
  124.     }
  125.     public function getTel(): ?string
  126.     {
  127.         return $this->tel;
  128.     }
  129.     public function setTel(string $tel): self
  130.     {
  131.         $this->tel $tel;
  132.         return $this;
  133.     }
  134.     public function isLivraison(): ?bool
  135.     {
  136.         return $this->livraison;
  137.     }
  138.     public function setLivraison(bool $livraison): self
  139.     {
  140.         $this->livraison $livraison;
  141.         return $this;
  142.     }
  143.     public function getAcompte(): ?float
  144.     {
  145.         return $this->acompte;
  146.     }
  147.     public function setAcompte(float $acompte): self
  148.     {
  149.         $this->acompte $acompte;
  150.         return $this;
  151.     }
  152.     public function getVoiture(): ?Voiture
  153.     {
  154.         return $this->voiture;
  155.     }
  156.     public function setVoiture(?Voiture $voiture): self
  157.     {
  158.         $this->voiture $voiture;
  159.         return $this;
  160.     }
  161. }