src/Entity/Gestiform/Admin/MasterListe/Masterliste.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gestiform\Admin\MasterListe;
  3. use App\Entity\AbstractEntity;
  4. use App\Repository\Gestiform\Admin\MasterlisteRepository;
  5. use App\Trait\ApiGestiformEntity;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10.  * @ORM\Entity(repositoryClass=MasterlisteRepository::class)
  11.  */
  12. class Masterliste extends AbstractEntity
  13. {
  14.     use ApiGestiformEntity;
  15.     /**
  16.      * @ORM\Column(type="string", length=255, nullable=false)
  17.      */
  18.     private  ?string $module null;
  19.     /**
  20.      * @ORM\Column(type="string", length=255, nullable=false)
  21.      */
  22.     private  ?string $code null;
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=false)
  25.      */
  26.     private  ?string $designation null;
  27.     /**
  28.      * @ORM\OneToMany(targetEntity=Masterlistelg::class, mappedBy="masterliste", orphanRemoval=true, cascade={"all"})
  29.      */
  30.     private Collection $masterlistelgs;
  31.     public function __construct()
  32.     {
  33.         $this->masterlistelgs = new ArrayCollection();
  34.     }
  35.     public function getModule(): ?string
  36.     {
  37.         return $this->module;
  38.     }
  39.     public function setModule(?string $module): self
  40.     {
  41.         $this->module $module;
  42.         return $this;
  43.     }
  44.     public function getCode(): ?string
  45.     {
  46.         return $this->code;
  47.     }
  48.     public function setCode(?string $code): self
  49.     {
  50.         $this->code $code;
  51.         return $this;
  52.     }
  53.     public function getDesignation(): ?string
  54.     {
  55.         return $this->designation;
  56.     }
  57.     public function setDesignation(?string $designation): self
  58.     {
  59.         $this->designation $designation;
  60.         return $this;
  61.     }
  62.     /**
  63.      * @return Collection<int, Masterlistelg>
  64.      */
  65.     public function getMasterlistelgs(): Collection
  66.     {
  67.         return $this->masterlistelgs;
  68.     }
  69.     public function addMasterlistelg(Masterlistelg $masterlistelg): self
  70.     {
  71.         if (!$this->masterlistelgs->contains($masterlistelg)) {
  72.             $this->masterlistelgs[] = $masterlistelg;
  73.             $masterlistelg->setMasterliste($this);
  74.         }
  75.         return $this;
  76.     }
  77.     public function removeMasterlistelg(Masterlistelg $masterlistelg): self
  78.     {
  79.         if ($this->masterlistelgs->removeElement($masterlistelg)) {
  80.             // set the owning side to null (unless already changed)
  81.            // if ($masterlistelg->getMasterliste() === $this) {
  82.                // $masterlistelg->setMasterliste(null);
  83.            // }
  84.         }
  85.         return $this;
  86.     }
  87. }