src/Entity/Permission.php line 12
<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;use App\Repository\PermissionRepository;use Doctrine\Common\Collections\Collection;#[ORM\Entity(repositoryClass: PermissionRepository::class)]class Permission{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column()]private ?int $id = null;#[ORM\Column]#[Gedmo\Timestampable(on: 'create')]private ?\DateTimeImmutable $createdAt = null;#[ORM\Column(length: 255)]private ?string $title = null;#[ORM\Column(length: 255)]private ?string $label = null;#[ORM\Column(nullable: true)]private ?int $authorId = null;#[ORM\ManyToMany(targetEntity: Role::class, inversedBy: 'permissions')]private ?Collection $roles = null;#[ORM\Column]private array $MetaData = [];public function __construct(){$this->roles = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getCreatedAt(): ?\DateTimeImmutable{return $this->createdAt;}public function setCreatedAt(\DateTimeImmutable $createdAt): self{$this->createdAt = $createdAt;return $this;}public function getTitle(): ?string{return $this->title;}public function setTitle(string $title): self{$this->title = $title;return $this;}public function getLabel(): ?string{return $this->label;}public function setLabel(string $label): self{$this->label = $label;return $this;}public function getAuthorId(): ?int{return $this->authorId;}public function setAuthorId(?int $authorId): self{$this->authorId = $authorId;return $this;}public function getMetaData(): array{return $this->MetaData;}public function setMetaData(array $MetaData): self{$this->MetaData = $MetaData;return $this;}/*** @return Collection<int, Role>*/public function getRoles(): Collection{return $this->roles;}public function addRole(Role $role): self{if (!$this->roles->contains($role)) {$this->roles->add($role);}return $this;}public function removeRole(Role $role): self{$this->roles->removeElement($role);return $this;}}