<?php
namespace App\Entity;
use App\Repository\TypeAbonnementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TypeAbonnementRepository::class)
*/
class TypeAbonnement
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $label;
/**
* @ORM\OneToMany(targetEntity=Abonnement::class, mappedBy="typeAbonnement")
*/
private $abonnements;
/**
* @ORM\Column(type="integer", options={"default": 0})
*/
private $prix;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $explication;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $stripeID;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $paymentLink;
public function __construct()
{
$this->abonnements = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
/**
* @return Collection|Abonnement[]
*/
public function getAbonnements(): Collection
{
return $this->abonnements;
}
public function addAbonnement(Abonnement $abonnement): self
{
if (!$this->abonnements->contains($abonnement)) {
$this->abonnements[] = $abonnement;
$abonnement->setTypeAbonnement($this);
}
return $this;
}
public function removeAbonnement(Abonnement $abonnement): self
{
if ($this->abonnements->removeElement($abonnement)) {
// set the owning side to null (unless already changed)
if ($abonnement->getTypeAbonnement() === $this) {
$abonnement->setTypeAbonnement(null);
}
}
return $this;
}
public function getPrix(): ?int
{
return $this->prix;
}
public function setPrix(int $prix): self
{
$this->prix = $prix;
return $this;
}
public function getExplication(): ?string
{
return $this->explication;
}
public function setExplication(?string $explication): self
{
$this->explication = $explication;
return $this;
}
public function getStripeID(): ?string
{
return $this->stripeID;
}
public function setStripeID(?string $stripeID): self
{
$this->stripeID = $stripeID;
return $this;
}
public function getPaymentLink(): ?string
{
return $this->paymentLink;
}
public function setPaymentLink(?string $paymentLink): self
{
$this->paymentLink = $paymentLink;
return $this;
}
}