src/Entity/Conditionnement.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\ConditionnementRepository")
  8.  */
  9. class Conditionnement
  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)
  19.      */
  20.     private $name;
  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="conditionnement")
  31.      */
  32.     private $letterOfIntentToPurchases;
  33.     /**
  34.      * @ORM\OneToMany(targetEntity="App\Entity\Quotation", mappedBy="conditionnement")
  35.      */
  36.     private $quotations;
  37.     /**
  38.      * @ORM\OneToMany(targetEntity="App\Entity\DemandeDeCotation", mappedBy="conditionnement")
  39.      */
  40.     private $demandeDeCotations;
  41.     public function __construct(){
  42.         $this->createdAt = new \DateTime('now');
  43.         $this->letterOfIntentToPurchases = new ArrayCollection();
  44.         $this->quotations = new ArrayCollection();
  45.         $this->demandeDeCotations = new ArrayCollection();
  46.     }
  47.     public function __toString(){
  48.         return $this->name;
  49.     }
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getName(): ?string
  55.     {
  56.         return $this->name;
  57.     }
  58.     public function setName(string $name): self
  59.     {
  60.         $this->name $name;
  61.         return $this;
  62.     }
  63.     public function getDescription(): ?string
  64.     {
  65.         return $this->description;
  66.     }
  67.     public function setDescription(?string $description): self
  68.     {
  69.         $this->description $description;
  70.         return $this;
  71.     }
  72.     public function getCreatedAt(): ?\DateTimeInterface
  73.     {
  74.         return $this->createdAt;
  75.     }
  76.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  77.     {
  78.         $this->createdAt $createdAt;
  79.         return $this;
  80.     }
  81.     /**
  82.      * @return Collection|LetterOfIntentToPurchase[]
  83.      */
  84.     public function getLetterOfIntentToPurchases(): Collection
  85.     {
  86.         return $this->letterOfIntentToPurchases;
  87.     }
  88.     public function addLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
  89.     {
  90.         if (!$this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
  91.             $this->letterOfIntentToPurchases[] = $letterOfIntentToPurchase;
  92.             $letterOfIntentToPurchase->setConditionnement($this);
  93.         }
  94.         return $this;
  95.     }
  96.     public function removeLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
  97.     {
  98.         if ($this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
  99.             $this->letterOfIntentToPurchases->removeElement($letterOfIntentToPurchase);
  100.             // set the owning side to null (unless already changed)
  101.             if ($letterOfIntentToPurchase->getConditionnement() === $this) {
  102.                 $letterOfIntentToPurchase->setConditionnement(null);
  103.             }
  104.         }
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return Collection |DemandeDeCotation[]
  109.      */
  110.     public function getDemandeDeCotations(): Collection
  111.     {
  112.         return $this->demandeDeCotations;
  113.     }
  114.     public function addDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
  115.     {
  116.         if (!$this->demandeDeCotations->contains($demandeDeCotation)) {
  117.             $this->demandeDeCotations[] = $demandeDeCotation;
  118.             $demandeDeCotation->setConditionnement($this);
  119.         }
  120.         return $this;
  121.     }
  122.     public function removeDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
  123.     {
  124.         if ($this->demandeDeCotations->contains($demandeDeCotation)) {
  125.             $this->demandeDeCotations->removeElement($demandeDeCotation);
  126.             // set the owning side to null (unless already changed)
  127.             if ($demandeDeCotation->getConditionnement() === $this) {
  128.                 $demandeDeCotation->setConditionnement(null);
  129.             }
  130.         }
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return Collection|Quotation[]
  135.      */
  136.     public function getQuotations(): Collection
  137.     {
  138.         return $this->quotations;
  139.     }
  140.     public function addQuotation(Quotation $quotation): self
  141.     {
  142.         if (!$this->quotations->contains($quotation)) {
  143.             $this->quotations[] = $quotation;
  144.             $quotation->setConditionnement($this);
  145.         }
  146.         return $this;
  147.     }
  148.     public function removeQuotation(Quotation $quotation): self
  149.     {
  150.         if ($this->quotations->contains($quotation)) {
  151.             $this->quotations->removeElement($quotation);
  152.             // set the owning side to null (unless already changed)
  153.             if ($quotation->getConditionnement() === $this) {
  154.                 $quotation->setConditionnement(null);
  155.             }
  156.         }
  157.         return $this;
  158.     }
  159. }