<?php
namespace App\Entity;
use App\Model\AclSettingConfig;
use App\Repository\AclSettingRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass=AclSettingRepository::class)
*
* @UniqueEntity(fields={"env", "route", "params", "component", "slug", "role", "job", "action"})
*/
class AclSetting
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @deprecated
* @ORM\Column(type="text", nullable=true)
*/
private $concatKey;
/**
* @ORM\Column(type="boolean")
*/
private $value;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $env;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $route;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $params;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $component;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $slug;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $role;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $action;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $job;
public function getId(): ?int
{
return $this->id;
}
public function getConcatKey(): ?string
{
return $this->concatKey;
}
public function setConcatKey(?string $concatKey): self
{
$this->concatKey = $concatKey;
return $this;
}
public function getValue(): ?bool
{
return $this->value;
}
public function setValue(bool $value): self
{
$this->value = $value;
return $this;
}
public function getEnv(): ?string
{
return $this->env;
}
public function setEnv(?string $env): self
{
$this->env = $env;
return $this;
}
public function getRoute(): ?string
{
return $this->route;
}
public function setRoute(?string $route): self
{
$this->route = $route;
return $this;
}
public function getParams(): ?string
{
return $this->params;
}
public function setParams(?string $params): self
{
$this->params = $params;
return $this;
}
public function getComponent(): ?string
{
return $this->component;
}
public function setComponent(?string $component): self
{
$this->component = $component;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getRole(): ?string
{
return $this->role;
}
public function setRole(?string $role): self
{
$this->role = $role;
return $this;
}
public function getAction(): ?string
{
return $this->action;
}
public function setAction(?string $action): self
{
$this->action = $action;
return $this;
}
public function getJob(): ?string
{
return $this->job;
}
public function setJob(?string $job): self
{
$this->job = $job;
return $this;
}
public function setFromAclSettingConfig(AclSettingConfig $config): AclSetting
{
foreach ($config->toArray() as $key => $value) {
$setter = 'set' . ucfirst($key);
if (method_exists($this, $setter)) {
$this->$setter($value);
}
}
return $this;
}
}