<?php
namespace App\Entity;
use App\Repository\StatutReparationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StatutReparationRepository::class)]
class StatutReparation implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $name;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $name_en;
#[ORM\OneToMany(targetEntity: FicheReparation::class, mappedBy: 'statut')]
private $ficheReparations;
public function __construct()
{
$this->ficheReparations = new ArrayCollection();
}
public function __toString(): string
{
return (string) $this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getNameEn(): ?string
{
return $this->name_en;
}
public function setNameEn(?string $name_en): self
{
$this->name_en = $name_en;
return $this;
}
/**
* @return Collection<int, FicheReparation>
*/
public function getFicheReparations(): Collection
{
return $this->ficheReparations;
}
public function addFicheReparation(FicheReparation $ficheReparation): self
{
if (!$this->ficheReparations->contains($ficheReparation)) {
$this->ficheReparations[] = $ficheReparation;
$ficheReparation->setStatut($this);
}
return $this;
}
public function removeFicheReparation(FicheReparation $ficheReparation): self
{
if ($this->ficheReparations->removeElement($ficheReparation)) {
// set the owning side to null (unless already changed)
if ($ficheReparation->getStatut() === $this) {
$ficheReparation->setStatut(null);
}
}
return $this;
}
}