<?php
namespace App\Entity;
use App\Repository\PStatutRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PStatutRepository::class)]
class PStatut
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $designation = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $icon = null;
#[ORM\OneToMany(mappedBy: 'statut', targetEntity: DemandeConge::class)]
private Collection $demandeConges;
#[ORM\Column(length: 255, nullable: true)]
private ?string $type = null;
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): self
{
$this->designation = $designation;
return $this;
}
public function getIcon(): ?string
{
return $this->icon;
}
public function setIcon(?string $icon): self
{
$this->icon = $icon;
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->setStatut($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->getStatut() === $this) {
$demandeConge->setStatut(null);
}
}
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): static
{
$this->type = $type;
return $this;
}
}