<?php
namespace App\Entity\Gestiform\Admin\MasterListe;
use App\Entity\AbstractEntity;
use App\Repository\Gestiform\Admin\MasterlisteRepository;
use App\Trait\ApiGestiformEntity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=MasterlisteRepository::class)
*/
class Masterliste extends AbstractEntity
{
use ApiGestiformEntity;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private ?string $module = null;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private ?string $code = null;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private ?string $designation = null;
/**
* @ORM\OneToMany(targetEntity=Masterlistelg::class, mappedBy="masterliste", orphanRemoval=true, cascade={"all"})
*/
private Collection $masterlistelgs;
public function __construct()
{
$this->masterlistelgs = new ArrayCollection();
}
public function getModule(): ?string
{
return $this->module;
}
public function setModule(?string $module): self
{
$this->module = $module;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(?string $code): self
{
$this->code = $code;
return $this;
}
public function getDesignation(): ?string
{
return $this->designation;
}
public function setDesignation(?string $designation): self
{
$this->designation = $designation;
return $this;
}
/**
* @return Collection<int, Masterlistelg>
*/
public function getMasterlistelgs(): Collection
{
return $this->masterlistelgs;
}
public function addMasterlistelg(Masterlistelg $masterlistelg): self
{
if (!$this->masterlistelgs->contains($masterlistelg)) {
$this->masterlistelgs[] = $masterlistelg;
$masterlistelg->setMasterliste($this);
}
return $this;
}
public function removeMasterlistelg(Masterlistelg $masterlistelg): self
{
if ($this->masterlistelgs->removeElement($masterlistelg)) {
// set the owning side to null (unless already changed)
// if ($masterlistelg->getMasterliste() === $this) {
// $masterlistelg->setMasterliste(null);
// }
}
return $this;
}
}