src/Entity/FicheControlePreserieType.php line 11

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