<?php
namespace App\Entity;
use App\Repository\UserAccessRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=UserAccessRepository::class)
*/
class UserAccess
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $displayName;
/**
* @ORM\Column(type="string", length=255)
*/
private $slug;
/**
* @ORM\ManyToMany(targetEntity=Users::class, inversedBy="accessModule")
*/
private $userId;
public function __construct()
{
$this->userId = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDisplayName(): ?string
{
return $this->displayName;
}
public function setDisplayName(string $displayName): self
{
$this->displayName = $displayName;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection<int, Users>
*/
public function getUserId(): Collection
{
return $this->userId;
}
public function addUserId(Users $userId): self
{
if (!$this->userId->contains($userId)) {
$this->userId[] = $userId;
}
return $this;
}
public function removeUserId(Users $userId): self
{
$this->userId->removeElement($userId);
return $this;
}
}