<?php
namespace App\Entity\Slave;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="eposm_s_permission_category")
* @ORM\Entity
*/
class PermissionCategory
{
/**
* @ORM\Column(name="id", type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="value", type="string", length=191)
*/
protected $value;
// OneToMany
/**
* @ORM\OneToMany(targetEntity="App\Entity\Slave\Permission", mappedBy="category")
*/
private $permissions;
//
public function __construct()
{
$this->permissions = new ArrayCollection();
}
public function getId(): ?string
{
return $this->id;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(string $value): self
{
$this->value = $value;
return $this;
}
/**
* @return Collection<int, Permission>
*/
public function getPermissions(): Collection
{
return $this->permissions;
}
public function addPermission(Permission $permission): self
{
if (!$this->permissions->contains($permission)) {
$this->permissions->add($permission);
$permission->setCategory($this);
}
return $this;
}
public function removePermission(Permission $permission): self
{
if ($this->permissions->removeElement($permission)) {
// set the owning side to null (unless already changed)
if ($permission->getCategory() === $this) {
$permission->setCategory(null);
}
}
return $this;
}
}