<?php
namespace App\Entity;
use App\Repository\PaymentMethodRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PaymentMethodRepository::class)
*/
class PaymentMethod
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $instructions;
/**
* @ORM\OneToMany(targetEntity=Payment::class, mappedBy="paymentMethod")
*/
private $payment;
public function __construct()
{
$this->payment = new ArrayCollection();
}
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 getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getInstructions(): ?string
{
return $this->instructions;
}
public function setInstructions(?string $instructions): self
{
$this->instructions = $instructions;
return $this;
}
/**
* @return Collection|Payment[]
*/
public function getPayment(): Collection
{
return $this->payment;
}
public function addPayment(Payment $payment): self
{
if (!$this->payment->contains($payment)) {
$this->payment[] = $payment;
$payment->setPaymentMethod($this);
}
return $this;
}
public function removePayment(Payment $payment): self
{
if ($this->payment->removeElement($payment)) {
// set the owning side to null (unless already changed)
if ($payment->getPaymentMethod() === $this) {
$payment->setPaymentMethod(null);
}
}
return $this;
}
}