Scope::class])] #[ORM\Entity] #[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')] #[ORM\Table(name: 'scopes')] class Scope { #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false, options: ['default' => true])] private bool $active = true; #[Groups(['read', 'docgen:read'])] #[ORM\Id] #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; /** * translatable names. */ #[Groups(['read', 'docgen:read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] #[Context(['is-translatable' => true], groups: ['docgen:read'])] private array $name = []; /** * @var Collection */ #[ORM\OneToMany(mappedBy: 'scope', targetEntity: RoleScope::class)] #[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')] private Collection $roleScopes; /** * Scope constructor. */ public function __construct() { $this->roleScopes = new ArrayCollection(); } public function addRoleScope(RoleScope $roleScope): self { $this->roleScopes->add($roleScope); return $this; } public function getId(): ?int { return $this->id; } public function getName(): array { return $this->name; } public function getRoleScopes(): Collection { return $this->roleScopes; } public function isActive(): bool { return $this->active; } public function setActive(bool $active): Scope { $this->active = $active; return $this; } /** * @return $this */ public function setName(array $name): self { $this->name = $name; return $this; } }