src/Entity/Emballage.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\EmballageRepository")
  8.  */
  9. class Emballage
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      */
  20.     private ?string $name null;
  21.     /**
  22.      * @ORM\Column(type="text", nullable=true)
  23.      */
  24.     private $description;
  25.     /**
  26.      * @ORM\Column(type="datetime", nullable=true)
  27.      */
  28.     private $createdAt;
  29.     /**
  30.      * @ORM\OneToMany(targetEntity="App\Entity\LetterOfIntentToPurchase", mappedBy="emballage")
  31.      */
  32.     private $letterOfIntentToPurchases;
  33.     /**
  34.      * @ORM\OneToMany(targetEntity="App\Entity\Quotation", mappedBy="emballage")
  35.      */
  36.     private $quotations;
  37.     /**
  38.      * @ORM\OneToMany(targetEntity="App\Entity\DemandeDeCotation", mappedBy="emballage")
  39.      */
  40.     private $demandeDeCotations;
  41.     public function __construct()
  42.     {
  43.         $this->letterOfIntentToPurchases = new ArrayCollection();
  44.         $this->quotations = new ArrayCollection();
  45.         $this->demandeDeCotations = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getName(): ?string
  52.     {
  53.         return $this->name;
  54.     }
  55.     public function setName(?string $name): self
  56.     {
  57.         $this->name $name;
  58.         return $this;
  59.     }
  60.     public function getDescription(): ?string
  61.     {
  62.         return $this->description;
  63.     }
  64.     public function setDescription(?string $description): self
  65.     {
  66.         $this->description $description;
  67.         return $this;
  68.     }
  69.     public function getCreatedAt(): ?\DateTimeInterface
  70.     {
  71.         return $this->createdAt;
  72.     }
  73.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  74.     {
  75.         $this->createdAt $createdAt;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return Collection|LetterOfIntentToPurchase[]
  80.      */
  81.     public function getLetterOfIntentToPurchases(): Collection
  82.     {
  83.         return $this->letterOfIntentToPurchases;
  84.     }
  85.     public function addLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
  86.     {
  87.         if (!$this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
  88.             $this->letterOfIntentToPurchases[] = $letterOfIntentToPurchase;
  89.             $letterOfIntentToPurchase->setEmballage($this);
  90.         }
  91.         return $this;
  92.     }
  93.     public function removeLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
  94.     {
  95.         if ($this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
  96.             $this->letterOfIntentToPurchases->removeElement($letterOfIntentToPurchase);
  97.             // set the owning side to null (unless already changed)
  98.             if ($letterOfIntentToPurchase->getEmballage() === $this) {
  99.                 $letterOfIntentToPurchase->setEmballage(null);
  100.             }
  101.         }
  102.         return $this;
  103.     }
  104.     /**
  105.      * @return Collection |DemandeDeCotation[]
  106.      */
  107.     public function getDemandeDeCotations(): Collection
  108.     {
  109.         return $this->demandeDeCotations;
  110.     }
  111.     public function addDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
  112.     {
  113.         if (!$this->demandeDeCotations->contains($demandeDeCotation)) {
  114.             $this->demandeDeCotations[] = $demandeDeCotation;
  115.             $demandeDeCotation->setEmballage($this);
  116.         }
  117.         return $this;
  118.     }
  119.     public function removeDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
  120.     {
  121.         if ($this->demandeDeCotations->contains($demandeDeCotation)) {
  122.             $this->demandeDeCotations->removeElement($demandeDeCotation);
  123.             // set the owning side to null (unless already changed)
  124.             if ($demandeDeCotation->getEmballage() === $this) {
  125.                 $demandeDeCotation->setEmballage(null);
  126.             }
  127.         }
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return Collection|Quotation[]
  132.      */
  133.     public function getQuotations(): Collection
  134.     {
  135.         return $this->quotations;
  136.     }
  137.     public function addQuotation(Quotation $quotation): self
  138.     {
  139.         if (!$this->quotations->contains($quotation)) {
  140.             $this->quotations[] = $quotation;
  141.             $quotation->setEmballage($this);
  142.         }
  143.         return $this;
  144.     }
  145.     public function removeQuotation(Quotation $quotation): self
  146.     {
  147.         if ($this->quotations->contains($quotation)) {
  148.             $this->quotations->removeElement($quotation);
  149.             // set the owning side to null (unless already changed)
  150.             if ($quotation->getEmballage() === $this) {
  151.                 $quotation->setEmballage(null);
  152.             }
  153.         }
  154.         return $this;
  155.     }
  156.     public function __toString(): string
  157.     {
  158.         return $this->name ?? 'N/A';
  159.     }
  160. }