src/Entity/UsModule.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UsModuleRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassUsModuleRepository::class)]
  8. class UsModule
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $designation null;
  16.     #[ORM\Column(length255nullabletrue)]
  17.     private ?string $prefix null;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     private ?string $icon null;
  20.     #[ORM\OneToMany(mappedBy'module'targetEntityUsSousModule::class)]
  21.     private Collection $sousModules;
  22.     #[ORM\Column]
  23.     private ?int $ordre null;
  24.     public function __construct()
  25.     {
  26.         $this->sousModules = new ArrayCollection();
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getDesignation(): ?string
  33.     {
  34.         return $this->designation;
  35.     }
  36.     public function setDesignation(string $designation): self
  37.     {
  38.         $this->designation $designation;
  39.         return $this;
  40.     }
  41.     public function getPrefix(): ?string
  42.     {
  43.         return $this->prefix;
  44.     }
  45.     public function setPrefix(?string $prefix): self
  46.     {
  47.         $this->prefix $prefix;
  48.         return $this;
  49.     }
  50.     public function getIcon(): ?string
  51.     {
  52.         return $this->icon;
  53.     }
  54.     public function setIcon(?string $icon): self
  55.     {
  56.         $this->icon $icon;
  57.         return $this;
  58.     }
  59.     /**
  60.      * @return Collection<int, UsSousModule>
  61.      */
  62.     public function getSousModules(): Collection
  63.     {
  64.         return $this->sousModules;
  65.     }
  66.     public function addSousModule(UsSousModule $sousModule): self
  67.     {
  68.         if (!$this->sousModules->contains($sousModule)) {
  69.             $this->sousModules->add($sousModule);
  70.             $sousModule->setModule($this);
  71.         }
  72.         return $this;
  73.     }
  74.     public function removeSousModule(UsSousModule $sousModule): self
  75.     {
  76.         if ($this->sousModules->removeElement($sousModule)) {
  77.             // set the owning side to null (unless already changed)
  78.             if ($sousModule->getModule() === $this) {
  79.                 $sousModule->setModule(null);
  80.             }
  81.         }
  82.         return $this;
  83.     }
  84.     public function getOrdre(): ?int
  85.     {
  86.         return $this->ordre;
  87.     }
  88.     public function setOrdre(int $ordre): static
  89.     {
  90.         $this->ordre $ordre;
  91.         return $this;
  92.     }
  93. }