<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\PaymentMethodRepository") */class PaymentMethod
{
/**
* @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id;
/**
* @ORM\Column(type="string", length=255) */ private $name;
/**
* @ORM\Column(type="datetime") */ private $createdAt;
/**
* @ORM\OneToMany(targetEntity="App\Entity\LetterOfIntentToPurchase", mappedBy="payment_method") */ private $letterOfIntentToPurchases;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Quotation", mappedBy="modeDeReglement") */ private $quotations;
/**
* @ORM\OneToMany(targetEntity="App\Entity\DemandeDeCotation", mappedBy="modedepayement") */ private $demandeDeCotations;
/**
* @ORM\Column(type="text", nullable=true) */ private $description;
public function __construct()
{ $this->letterOfIntentToPurchases = new ArrayCollection();
$this->quotations = new ArrayCollection();
$this->demandeDeCotations = new ArrayCollection();
$this->createdAt = new \DateTime('now');
} public function getId(): ?int
{
return $this->id;
} public function getName(): ?string
{
return $this->name;
} public function setName(string $name): self
{
$this->name = $name;
return $this;
} public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
} public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
} /**
* @return Collection|LetterOfIntentToPurchase[] */ public function getLetterOfIntentToPurchases(): Collection
{
return $this->letterOfIntentToPurchases;
} public function addLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
{
if (!$this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
$this->letterOfIntentToPurchases[] = $letterOfIntentToPurchase;
$letterOfIntentToPurchase->setPaymentMethod($this);
} return $this;
} public function removeLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
{
if ($this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
$this->letterOfIntentToPurchases->removeElement($letterOfIntentToPurchase);
// set the owning side to null (unless already changed)
if ($letterOfIntentToPurchase->getPaymentMethod() === $this) {
$letterOfIntentToPurchase->setPaymentMethod(null);
} } return $this;
} /**
* @return Collection| DemandeDeCotation[] */ public function getDemandeDeCotations(): Collection
{
return $this->demandeDeCotations;
} public function addDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
{
if (!$this->demandeDeCotations->contains($demandeDeCotation)) {
$this->demandeDeCotations[] = $demandeDeCotation;
$demandeDeCotation->setModeDePayement($this);
} return $this;
} public function removeDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
{
if ($this->demandeDeCotations->contains($demandeDeCotation)) {
$this->demandeDeCotations->removeElement($demandeDeCotation);
// set the owning side to null (unless already changed)
if ($demandeDeCotation->getModeDePayement() === $this) {
$demandeDeCotation->setModeDePayement(null);
} } return $this;
} /**
* @return Collection|Quotation[] */ public function getQuotations(): Collection
{
return $this->quotations;
} public function addQuotation(Quotation $quotation): self
{
if (!$this->quotations->contains($quotation)) {
$this->quotations[] = $quotation;
$quotation->setModeDeReglement($this);
} return $this;
} public function removeQuotation(Quotation $quotation): self
{
if ($this->quotations->contains($quotation)) {
$this->quotations->removeElement($quotation);
// set the owning side to null (unless already changed)
if ($quotation->getModeDeReglement() === $this) {
$quotation->setModeDeReglement(null);
} } return $this;
} public function __toString(){
return $this->name;
} public function getDescription(): ?string
{
return $this->description;
} public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}}