<?php
namespace App\Entity;
use App\Repository\PBaremeTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PBaremeTypeRepository::class)]
class PBaremeType
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $designation = null;
#[ORM\OneToMany(mappedBy: 'baremeType', targetEntity: Pbareme::class)]
private Collection $baremes;
public function __construct()
{
$this->baremes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDesignation(): ?string
{
return $this->designation;
}
public function setDesignation(?string $designation): static
{
$this->designation = $designation;
return $this;
}
/**
* @return Collection<int, Pbareme>
*/
public function getBaremes(): Collection
{
return $this->baremes;
}
public function addBareme(Pbareme $bareme): static
{
if (!$this->baremes->contains($bareme)) {
$this->baremes->add($bareme);
$bareme->setBaremeType($this);
}
return $this;
}
public function removeBareme(Pbareme $bareme): static
{
if ($this->baremes->removeElement($bareme)) {
// set the owning side to null (unless already changed)
if ($bareme->getBaremeType() === $this) {
$bareme->setBaremeType(null);
}
}
return $this;
}
}