src/Entity/Livraison.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LivraisonRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=LivraisonRepository::class)
  9.  */
  10. class Livraison
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="datetime_immutable")
  20.      */
  21.     private $createdAt;
  22.     /**
  23.      * @ORM\Column(type="float")
  24.      */
  25.     private $tarif;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="livraisons")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $livreur;
  31.     /**
  32.      * @ORM\OneToMany(targetEntity=Parcours::class, mappedBy="livraison")
  33.      */
  34.     private $parcours;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity=SocieteLivraison::class, inversedBy="livraisons")
  37.      * @ORM\JoinColumn(nullable=false)
  38.      */
  39.     private $societeLivraison;
  40.     /**
  41.      * @ORM\Column(type="integer", nullable=true)
  42.      */
  43.     private $code;
  44.     /**
  45.      * @ORM\Column(type="integer", nullable=true)
  46.      */
  47.     private $codeSecret;
  48.     public function __construct()
  49.     {
  50.         $this->parcours = new ArrayCollection();
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getCreatedAt(): ?\DateTimeImmutable
  57.     {
  58.         return $this->createdAt;
  59.     }
  60.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  61.     {
  62.         $this->createdAt $createdAt;
  63.         return $this;
  64.     }
  65.     public function getTarif(): ?float
  66.     {
  67.         return $this->tarif;
  68.     }
  69.     public function setTarif(float $tarif): self
  70.     {
  71.         $this->tarif $tarif;
  72.         return $this;
  73.     }
  74.     public function getLivreur(): ?User
  75.     {
  76.         return $this->livreur;
  77.     }
  78.     public function setLivreur(?User $livreur): self
  79.     {
  80.         $this->livreur $livreur;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, Parcours>
  85.      */
  86.     public function getParcours(): Collection
  87.     {
  88.         return $this->parcours;
  89.     }
  90.     public function addParcour(Parcours $parcour): self
  91.     {
  92.         if (!$this->parcours->contains($parcour)) {
  93.             $this->parcours[] = $parcour;
  94.             $parcour->setLivraison($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeParcour(Parcours $parcour): self
  99.     {
  100.         if ($this->parcours->removeElement($parcour)) {
  101.             // set the owning side to null (unless already changed)
  102.             if ($parcour->getLivraison() === $this) {
  103.                 $parcour->setLivraison(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     public function getSocieteLivraison(): ?SocieteLivraison
  109.     {
  110.         return $this->societeLivraison;
  111.     }
  112.     public function setSocieteLivraison(?SocieteLivraison $societeLivraison): self
  113.     {
  114.         $this->societeLivraison $societeLivraison;
  115.         return $this;
  116.     }
  117.     public function getCode(): ?int
  118.     {
  119.         return $this->code;
  120.     }
  121.     public function setCode(?int $code): self
  122.     {
  123.         $this->code $code;
  124.         return $this;
  125.     }
  126.     public function getCodeSecret(): ?int
  127.     {
  128.         return $this->codeSecret;
  129.     }
  130.     public function setCodeSecret(?int $codeSecret): self
  131.     {
  132.         $this->codeSecret $codeSecret;
  133.         return $this;
  134.     }
  135. }