src/Entity/TypeOfTypes.php line 15

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Repository\TypeOfTypesRepository;
  5. use App\Utils\Traits\EntityId_TimestampTrait;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Uid\Ulid;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. #[ORM\Entity(repositoryClassTypeOfTypesRepository::class)]
  11. class TypeOfTypes
  12. {
  13.     use EntityId_TimestampTrait;
  14.     #[ORM\Column(type'string'length200)]
  15.     private $libelle;
  16.     #[ORM\Column(type'string'length200nullabletrue)]
  17.     private $libelleFr;
  18.     #[ORM\ManyToOne(targetEntityself::class)]
  19.     private $parent;
  20.     #[ORM\Column(type'string'length255uniquetrue)]
  21.     private $codereference;
  22.     #[ORM\OneToMany(mappedBy'fonction'targetEntityFonctionUser::class)]
  23.     private Collection $fonctionUsers;
  24.     #[ORM\OneToMany(mappedBy'fonction'targetEntityFonctionAction::class)]
  25.     private Collection $fonctionActions;
  26.     #[ORM\OneToMany(mappedBy'category'targetEntityLibraryAssets::class)]
  27.     private Collection $libraryAssets;
  28.     public function __construct()
  29.     {
  30.         $this->uuid = new Ulid();
  31.         $this->created = new \DateTimeImmutable('now');
  32.         $this->updated = new \DateTime('now');
  33.         $this->deleted false;
  34.         $this->fonctionUsers = new ArrayCollection();
  35.         $this->fonctionActions = new ArrayCollection();
  36.         $this->libraryAssets = new ArrayCollection();
  37.     }
  38.     public function __toString()
  39.     {
  40.         return $this->libelle;
  41.     }
  42.     public function getLibelle(): ?string
  43.     {
  44.         return $this->libelle;
  45.     }
  46.     public function setLibelle(string $libelle): self
  47.     {
  48.         $this->libelle $libelle;
  49.         return $this;
  50.     }
  51.     public function getParent(): ?self
  52.     {
  53.         return $this->parent;
  54.     }
  55.     public function setParent(?self $parent): self
  56.     {
  57.         $this->parent $parent;
  58.         return $this;
  59.     }
  60.     public function getCodereference(): ?string
  61.     {
  62.         return $this->codereference;
  63.     }
  64.     public function setCodereference(string $codereference): self
  65.     {
  66.         $this->codereference $codereference;
  67.         return $this;
  68.     }
  69.     public function getId()
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getLibelleFr(): ?string
  74.     {
  75.         return $this->libelleFr;
  76.     }
  77.     public function setLibelleFr(?string $libelleFr): self
  78.     {
  79.         $this->libelleFr $libelleFr;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection<int, FonctionUser>
  84.      */
  85.     public function getFonctionUsers(): Collection
  86.     {
  87.         return $this->fonctionUsers;
  88.     }
  89.     public function addFonctionUser(FonctionUser $fonctionUser): self
  90.     {
  91.         if (!$this->fonctionUsers->contains($fonctionUser)) {
  92.             $this->fonctionUsers->add($fonctionUser);
  93.             $fonctionUser->setFonction($this);
  94.         }
  95.         return $this;
  96.     }
  97.     public function removeFonctionUser(FonctionUser $fonctionUser): self
  98.     {
  99.         if ($this->fonctionUsers->removeElement($fonctionUser)) {
  100.             // set the owning side to null (unless already changed)
  101.             if ($fonctionUser->getFonction() === $this) {
  102.                 $fonctionUser->setFonction(null);
  103.             }
  104.         }
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return Collection<int, FonctionAction>
  109.      */
  110.     public function getFonctionActions(): Collection
  111.     {
  112.         return $this->fonctionActions;
  113.     }
  114.     public function addFonctionAction(FonctionAction $fonctionAction): self
  115.     {
  116.         if (!$this->fonctionActions->contains($fonctionAction)) {
  117.             $this->fonctionActions->add($fonctionAction);
  118.             $fonctionAction->setFonction($this);
  119.         }
  120.         return $this;
  121.     }
  122.     public function removeFonctionAction(FonctionAction $fonctionAction): self
  123.     {
  124.         if ($this->fonctionActions->removeElement($fonctionAction)) {
  125.             // set the owning side to null (unless already changed)
  126.             if ($fonctionAction->getFonction() === $this) {
  127.                 $fonctionAction->setFonction(null);
  128.             }
  129.         }
  130.         return $this;
  131.     }
  132.     /**
  133.      * @return Collection<int, LibraryAssets>
  134.      */
  135.     public function getLibraryAssets(): Collection
  136.     {
  137.         return $this->libraryAssets;
  138.     }
  139.     public function addLibraryAsset(LibraryAssets $libraryAsset): self
  140.     {
  141.         if (!$this->libraryAssets->contains($libraryAsset)) {
  142.             $this->libraryAssets->add($libraryAsset);
  143.             $libraryAsset->setCategory($this);
  144.         }
  145.         return $this;
  146.     }
  147.     public function removeLibraryAsset(LibraryAssets $libraryAsset): self
  148.     {
  149.         if ($this->libraryAssets->removeElement($libraryAsset)) {
  150.             // set the owning side to null (unless already changed)
  151.             if ($libraryAsset->getCategory() === $this) {
  152.                 $libraryAsset->setCategory(null);
  153.             }
  154.         }
  155.         return $this;
  156.     }
  157. }