src/Entity/PortalAdministratorPermission.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PortalAdministratorPermissionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPortalAdministratorPermissionRepository::class)]
  8. class PortalAdministratorPermission
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $name null;
  16.     #[ORM\ManyToMany(targetEntityPortalAdministratorGroup::class, mappedBy'portalAdministratorPermissions')]
  17.     private Collection $portalAdministratorGroup;
  18.     public function __construct()
  19.     {
  20.         $this->portalAdministratorGroup = new ArrayCollection();
  21.     }
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function __toString(): string
  27.     {
  28.         return $this->name;
  29.     }
  30.     public function getName(): ?string
  31.     {
  32.         return $this->name;
  33.     }
  34.     public function setName(string $name): self
  35.     {
  36.         $this->name $name;
  37.         return $this;
  38.     }
  39.     /**
  40.      * @return Collection<int, PortalAdministratorGroup>
  41.      */
  42.     public function getPortalAdministratorGroup(): Collection
  43.     {
  44.         return $this->portalAdministratorGroup;
  45.     }
  46.     public function addPortalAdministratorGroup(PortalAdministratorGroup $portalAdministratorGroup): self
  47.     {
  48.         if (!$this->portalAdministratorGroup->contains($portalAdministratorGroup)) {
  49.             $this->portalAdministratorGroup->add($portalAdministratorGroup);
  50.         }
  51.         return $this;
  52.     }
  53.     public function removePortalAdministratorGroup(PortalAdministratorGroup $portalAdministratorGroup): self
  54.     {
  55.         $this->portalAdministratorGroup->removeElement($portalAdministratorGroup);
  56.         return $this;
  57.     }
  58. }