<?php
namespace App\Entity;
use App\Repository\AuthorizedActionsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AuthorizedActionsRepository::class)
*/
class AuthorizedActions
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="boolean")
*/
private $deleted = false;
/**
* @ORM\OneToMany(targetEntity=RolesAuthorizedActions::class, mappedBy="authorizedAction")
*/
private $rolesAuthorizedActions;
public function __construct()
{
$this->rolesAuthorizedActions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function isDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(bool $deleted): self
{
$this->deleted = $deleted;
return $this;
}
/**
* @return Collection<int, RolesAuthorizedActions>
*/
public function getRolesAuthorizedActions(): Collection
{
return $this->rolesAuthorizedActions;
}
public function addRolesAuthorizedAction(RolesAuthorizedActions $rolesAuthorizedAction): self
{
if (!$this->rolesAuthorizedActions->contains($rolesAuthorizedAction)) {
$this->rolesAuthorizedActions[] = $rolesAuthorizedAction;
$rolesAuthorizedAction->setAuthorizedAction($this);
}
return $this;
}
public function removeRolesAuthorizedAction(RolesAuthorizedActions $rolesAuthorizedAction): self
{
if ($this->rolesAuthorizedActions->removeElement($rolesAuthorizedAction)) {
// set the owning side to null (unless already changed)
if ($rolesAuthorizedAction->getAuthorizedAction() === $this) {
$rolesAuthorizedAction->setAuthorizedAction(null);
}
}
return $this;
}
}