<?php
namespace App\Entity;
use App\Repository\StatutAvoirAchatRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StatutAvoirAchatRepository::class)]
class StatutAvoirAchat implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $name_fr;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $name_en;
#[ORM\OneToMany(targetEntity: FicheAvoir::class, mappedBy: 'statut_achat')]
private $ficheAvoirs;
public function __construct()
{
$this->ficheAvoirs = new ArrayCollection();
}
public function __toString(): string{
return (string) $this->name_fr;
}
public function getId(): ?int
{
return $this->id;
}
public function getNameFr(): ?string
{
return $this->name_fr;
}
public function setNameFr(?string $name_fr): self
{
$this->name_fr = $name_fr;
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, FicheAvoir>
*/
public function getFicheAvoirs(): Collection
{
return $this->ficheAvoirs;
}
public function addFicheAvoir(FicheAvoir $ficheAvoir): self
{
if (!$this->ficheAvoirs->contains($ficheAvoir)) {
$this->ficheAvoirs[] = $ficheAvoir;
$ficheAvoir->setStatutAchat($this);
}
return $this;
}
public function removeFicheAvoir(FicheAvoir $ficheAvoir): self
{
if ($this->ficheAvoirs->removeElement($ficheAvoir)) {
// set the owning side to null (unless already changed)
if ($ficheAvoir->getStatutAchat() === $this) {
$ficheAvoir->setStatutAchat(null);
}
}
return $this;
}
}