<?php
namespace App\Entity;
use App\Repository\PTypeCongeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PTypeCongeRepository::class)]
class PTypeConge
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $designation = null;
#[ORM\Column(nullable: true)]
private ?bool $active = null;
#[ORM\OneToMany(mappedBy: 'typeConge', targetEntity: DemandeConge::class)]
private Collection $demandeConges;
public function __construct()
{
$this->demandeConges = 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;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(?bool $active): static
{
$this->active = $active;
return $this;
}
/**
* @return Collection<int, DemandeConge>
*/
public function getDemandeConges(): Collection
{
return $this->demandeConges;
}
public function addDemandeConge(DemandeConge $demandeConge): static
{
if (!$this->demandeConges->contains($demandeConge)) {
$this->demandeConges->add($demandeConge);
$demandeConge->setTypeConge($this);
}
return $this;
}
public function removeDemandeConge(DemandeConge $demandeConge): static
{
if ($this->demandeConges->removeElement($demandeConge)) {
// set the owning side to null (unless already changed)
if ($demandeConge->getTypeConge() === $this) {
$demandeConge->setTypeConge(null);
}
}
return $this;
}
}