src/Entity/IctusTypeLivraison.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\IctusTypeLivraisonRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=IctusTypeLivraisonRepository::class)
  9.  */
  10. class IctusTypeLivraison
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $designation;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=LivraisonPharmacie::class, mappedBy="ictus_type_livraison")
  24.      */
  25.     private $livraisonPharmacies;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=IctusCommande::class, mappedBy="typeLivraison")
  28.      */
  29.     private $ictusCommandes;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=CommandeSpecial::class, mappedBy="typeLivraison")
  32.      */
  33.     private $commandeSpecials;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=User::class, mappedBy="lastTypeLivraison")
  36.      */
  37.     private $users;
  38.     public function __construct()
  39.     {
  40.         $this->livraisonPharmacies = new ArrayCollection();
  41.         $this->ictusCommandes = new ArrayCollection();
  42.         $this->commandeSpecials = new ArrayCollection();
  43.         $this->users = new ArrayCollection();
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getDesignation(): ?string
  50.     {
  51.         return $this->designation;
  52.     }
  53.     public function setDesignation(string $designation): self
  54.     {
  55.         $this->designation $designation;
  56.         return $this;
  57.     }
  58.     /**
  59.      * @return Collection<int, LivraisonPharmacie>
  60.      */
  61.     public function getLivraisonPharmacies(): Collection
  62.     {
  63.         return $this->livraisonPharmacies;
  64.     }
  65.     public function addLivraisonPharmacy(LivraisonPharmacie $livraisonPharmacy): self
  66.     {
  67.         if (!$this->livraisonPharmacies->contains($livraisonPharmacy)) {
  68.             $this->livraisonPharmacies[] = $livraisonPharmacy;
  69.             $livraisonPharmacy->setIctusTypeLivraison($this);
  70.         }
  71.         return $this;
  72.     }
  73.     public function removeLivraisonPharmacy(LivraisonPharmacie $livraisonPharmacy): self
  74.     {
  75.         if ($this->livraisonPharmacies->removeElement($livraisonPharmacy)) {
  76.             // set the owning side to null (unless already changed)
  77.             if ($livraisonPharmacy->getIctusTypeLivraison() === $this) {
  78.                 $livraisonPharmacy->setIctusTypeLivraison(null);
  79.             }
  80.         }
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, IctusCommande>
  85.      */
  86.     public function getIctusCommandes(): Collection
  87.     {
  88.         return $this->ictusCommandes;
  89.     }
  90.     public function addIctusCommande(IctusCommande $ictusCommande): self
  91.     {
  92.         if (!$this->ictusCommandes->contains($ictusCommande)) {
  93.             $this->ictusCommandes[] = $ictusCommande;
  94.             $ictusCommande->setTypeLivraison($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeIctusCommande(IctusCommande $ictusCommande): self
  99.     {
  100.         if ($this->ictusCommandes->removeElement($ictusCommande)) {
  101.             // set the owning side to null (unless already changed)
  102.             if ($ictusCommande->getTypeLivraison() === $this) {
  103.                 $ictusCommande->setTypeLivraison(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     /**
  109.      * @return Collection<int, CommandeSpecial>
  110.      */
  111.     public function getCommandeSpecials(): Collection
  112.     {
  113.         return $this->commandeSpecials;
  114.     }
  115.     public function addCommandeSpecial(CommandeSpecial $commandeSpecial): self
  116.     {
  117.         if (!$this->commandeSpecials->contains($commandeSpecial)) {
  118.             $this->commandeSpecials[] = $commandeSpecial;
  119.             $commandeSpecial->setTypeLivraison($this);
  120.         }
  121.         return $this;
  122.     }
  123.     public function removeCommandeSpecial(CommandeSpecial $commandeSpecial): self
  124.     {
  125.         if ($this->commandeSpecials->removeElement($commandeSpecial)) {
  126.             // set the owning side to null (unless already changed)
  127.             if ($commandeSpecial->getTypeLivraison() === $this) {
  128.                 $commandeSpecial->setTypeLivraison(null);
  129.             }
  130.         }
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return Collection<int, User>
  135.      */
  136.     public function getUsers(): Collection
  137.     {
  138.         return $this->users;
  139.     }
  140.     public function addUser(User $user): self
  141.     {
  142.         if (!$this->users->contains($user)) {
  143.             $this->users[] = $user;
  144.             $user->setLastTypeLivraison($this);
  145.         }
  146.         return $this;
  147.     }
  148.     public function removeUser(User $user): self
  149.     {
  150.         if ($this->users->removeElement($user)) {
  151.             // set the owning side to null (unless already changed)
  152.             if ($user->getLastTypeLivraison() === $this) {
  153.                 $user->setLastTypeLivraison(null);
  154.             }
  155.         }
  156.         return $this;
  157.     }
  158. }