src/Entity/Livraison.php line 12

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\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassLivraisonRepository::class)]
  9. class Livraison
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  16.     private ?\DateTimeInterface $date null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $statut null;
  19.     #[ORM\ManyToOne(inversedBy'livraisons')]
  20.     private ?Livreur $livreur null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $adresse null;
  23.     #[ORM\OneToMany(mappedBy'livraison'targetEntityLivraisonProd::class, cascade: ['persist'])]
  24.     private Collection $livraisonProds;
  25.     #[ORM\OneToMany(mappedBy'livraison'targetEntityEcheance::class)]
  26.     private Collection $echeances;
  27.     #[ORM\ManyToOne(inversedBy'livraisons')]
  28.     private ?Client $client null;
  29.     public function __construct()
  30.     {
  31.         $this->livraisonProds = new ArrayCollection();
  32.         $this->echeances = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getDate(): ?\DateTimeInterface
  39.     {
  40.         return $this->date;
  41.     }
  42.     public function setDate(\DateTimeInterface $date): static
  43.     {
  44.         $this->date $date;
  45.         return $this;
  46.     }
  47.     public function getStatut(): ?string
  48.     {
  49.         return $this->statut;
  50.     }
  51.     public function setStatut(string $statut): static
  52.     {
  53.         $this->statut $statut;
  54.         return $this;
  55.     }
  56.     public function getLivreur(): ?Livreur
  57.     {
  58.         return $this->livreur;
  59.     }
  60.     public function setLivreur(?Livreur $livreur): static
  61.     {
  62.         $this->livreur $livreur;
  63.         return $this;
  64.     }
  65.     public function getAdresse(): ?string
  66.     {
  67.         return $this->adresse;
  68.     }
  69.     public function setAdresse(?string $adresse): static
  70.     {
  71.         $this->adresse $adresse;
  72.         return $this;
  73.     }
  74.     /**
  75.      * @return Collection<int, LivraisonProd>
  76.      */
  77.     public function getLivraisonProds(): Collection
  78.     {
  79.         return $this->livraisonProds;
  80.     }
  81.     public function addLivraisonProd(LivraisonProd $livraisonProd): static
  82.     {
  83.         if (!$this->livraisonProds->contains($livraisonProd)) {
  84.             $this->livraisonProds->add($livraisonProd);
  85.             $livraisonProd->setLivraison($this);
  86.         }
  87.         return $this;
  88.     }
  89.     public function removeLivraisonProd(LivraisonProd $livraisonProd): static
  90.     {
  91.         if ($this->livraisonProds->removeElement($livraisonProd)) {
  92.             // set the owning side to null (unless already changed)
  93.             if ($livraisonProd->getLivraison() === $this) {
  94.                 $livraisonProd->setLivraison(null);
  95.             }
  96.         }
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection<int, Echeance>
  101.      */
  102.     public function getEcheances(): Collection
  103.     {
  104.         return $this->echeances;
  105.     }
  106.     public function addEcheance(Echeance $echeance): static
  107.     {
  108.         if (!$this->echeances->contains($echeance)) {
  109.             $this->echeances->add($echeance);
  110.             $echeance->setLivraison($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeEcheance(Echeance $echeance): static
  115.     {
  116.         if ($this->echeances->removeElement($echeance)) {
  117.             // set the owning side to null (unless already changed)
  118.             if ($echeance->getLivraison() === $this) {
  119.                 $echeance->setLivraison(null);
  120.             }
  121.         }
  122.         return $this;
  123.     }
  124.     public function getClient(): ?Client
  125.     {
  126.         return $this->client;
  127.     }
  128.     public function setClient(?Client $client): static
  129.     {
  130.         $this->client $client;
  131.         return $this;
  132.     }
  133. }