src/Entity/StatutReparation.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StatutReparationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassStatutReparationRepository::class)]
  8. class StatutReparation 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;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $name_en;
  18.     #[ORM\OneToMany(targetEntityFicheReparation::class, mappedBy'statut')]
  19.     private $ficheReparations;
  20.     public function __construct()
  21.     {
  22.         $this->ficheReparations = new ArrayCollection();
  23.     }
  24.     public function __toString(): string
  25.     {
  26.         return (string) $this->name;
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getName(): ?string
  33.     {
  34.         return $this->name;
  35.     }
  36.     public function setName(?string $name): self
  37.     {
  38.         $this->name $name;
  39.         return $this;
  40.     }
  41.     public function getNameEn(): ?string
  42.     {
  43.         return $this->name_en;
  44.     }
  45.     public function setNameEn(?string $name_en): self
  46.     {
  47.         $this->name_en $name_en;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return Collection<int, FicheReparation>
  52.      */
  53.     public function getFicheReparations(): Collection
  54.     {
  55.         return $this->ficheReparations;
  56.     }
  57.     public function addFicheReparation(FicheReparation $ficheReparation): self
  58.     {
  59.         if (!$this->ficheReparations->contains($ficheReparation)) {
  60.             $this->ficheReparations[] = $ficheReparation;
  61.             $ficheReparation->setStatut($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeFicheReparation(FicheReparation $ficheReparation): self
  66.     {
  67.         if ($this->ficheReparations->removeElement($ficheReparation)) {
  68.             // set the owning side to null (unless already changed)
  69.             if ($ficheReparation->getStatut() === $this) {
  70.                 $ficheReparation->setStatut(null);
  71.             }
  72.         }
  73.         return $this;
  74.     }
  75. }