src/Entity/StatutAvoirAchat.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StatutAvoirAchatRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassStatutAvoirAchatRepository::class)]
  8. class StatutAvoirAchat implements \Stringable
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private $name_fr;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $name_en;
  18.     #[ORM\OneToMany(targetEntityFicheAvoir::class, mappedBy'statut_achat')]
  19.     private $ficheAvoirs;
  20.     public function __construct()
  21.     {
  22.         $this->ficheAvoirs = new ArrayCollection();
  23.     }
  24.     public function __toString(): string{
  25.         return (string) $this->name_fr;
  26.     }
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getNameFr(): ?string
  32.     {
  33.         return $this->name_fr;
  34.     }
  35.     public function setNameFr(?string $name_fr): self
  36.     {
  37.         $this->name_fr $name_fr;
  38.         return $this;
  39.     }
  40.     public function getNameEn(): ?string
  41.     {
  42.         return $this->name_en;
  43.     }
  44.     public function setNameEn(?string $name_en): self
  45.     {
  46.         $this->name_en $name_en;
  47.         return $this;
  48.     }
  49.     /**
  50.      * @return Collection<int, FicheAvoir>
  51.      */
  52.     public function getFicheAvoirs(): Collection
  53.     {
  54.         return $this->ficheAvoirs;
  55.     }
  56.     public function addFicheAvoir(FicheAvoir $ficheAvoir): self
  57.     {
  58.         if (!$this->ficheAvoirs->contains($ficheAvoir)) {
  59.             $this->ficheAvoirs[] = $ficheAvoir;
  60.             $ficheAvoir->setStatutAchat($this);
  61.         }
  62.         return $this;
  63.     }
  64.     public function removeFicheAvoir(FicheAvoir $ficheAvoir): self
  65.     {
  66.         if ($this->ficheAvoirs->removeElement($ficheAvoir)) {
  67.             // set the owning side to null (unless already changed)
  68.             if ($ficheAvoir->getStatutAchat() === $this) {
  69.                 $ficheAvoir->setStatutAchat(null);
  70.             }
  71.         }
  72.         return $this;
  73.     }
  74. }