<?phpnamespace App\Entity\Main;use App\Repository\Main\CartoBonRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=CartoBonRepository::class) */class CartoBon{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="integer", unique=true) */ private $idBon; /** * @ORM\Column(type="integer") */ private $type; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\ManyToMany(targetEntity=Forfait::class, inversedBy="cartoBons") */ private $forfait; public function __construct() { $this->forfait = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getIdBon(): ?int { return $this->idBon; } public function setIdBon(int $idBon): self { $this->idBon = $idBon; return $this; } public function getType(): ?int { return $this->type; } public function setType(int $type): self { $this->type = $type; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } /** * @return Collection|Forfait[] */ public function getForfait(): Collection { return $this->forfait; } public function addForfait(Forfait $forfait): self { if (!$this->forfait->contains($forfait)) { $this->forfait[] = $forfait; } return $this; } public function removeForfait(Forfait $forfait): self { $this->forfait->removeElement($forfait); return $this; }}