<?php
namespace App\Entity;
use App\Repository\TypeCarteTierRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TypeCarteTierRepository::class)
*/
class TypeCarteTier
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private ?int $id = null;
/**
* @ORM\Column(type="string", length=255)
*/
private $libelle;
/**
* @ORM\OneToMany(targetEntity=CarteTier::class, mappedBy="typeCarteTier")
*/
private $carteTier;
public function __toString()
{
return $this->libelle;
}
public function __construct()
{
$this->carteTier = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
/**
* @return Collection<int, carteTier>
*/
public function getcarteTier(): Collection
{
return $this->carteTier;
}
public function addcarteTier(carteTier $carteTier): self
{
if (!$this->carteTier->contains($carteTier)) {
$this->carteTier[] = $carteTier;
$carteTier->setTypeCarte($this);
}
return $this;
}
public function removecarteTier(carteTier $carteTier): self
{
if ($this->carteTier->removeElement($carteTier)) {
// set the owning side to null (unless already changed)
if ($carteTier->getTypeCarte() === $this) {
$carteTier->setTypeCarte(null);
}
}
return $this;
}
}