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