PrivilegeGroup
extends PrivilegeGroup
in package
Functional group of privileges (`cms_system_privilege_groups`): a purely presentational grouping across the `:Admin` / `:Front` / `:Api` branches.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_system_privilege_groups'
- #[TableAlias]
- 'privilegeGroup'
Table of Contents
Properties
- $entity : string
- $family : string
- `show`, `save`, `delete` or a standalone action name.
- $id : int|null
- $key : string
- `<Module>:<Entity>:<family>`, e.g. `Eshop:Order:show`, without a leading colon.
- $module : string
- $sort : int
- $translations : Collection
Methods
- __construct() : mixed
- addTranslation() : $this
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getEntity() : string
- getFamily() : string
- getId() : int|null
- getKey() : string
- getModule() : string
- getSort() : int
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- isPersisted() : bool
- removeTranslation() : $this
- setEntity() : $this
- setFamily() : $this
- setId() : $this
- setKey() : $this
- setModule() : $this
- setSort() : $this
- setTranslations() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$entity
protected
string
$entity
= ''
Attributes
- #[Column]
- $name: 'entity'
- $type: 'string'
- $length: 100
$family
`show`, `save`, `delete` or a standalone action name.
protected
string
$family
= ''
Attributes
- #[Column]
- $name: 'family'
- $type: 'string'
- $length: 50
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'privilege_group_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$key
`<Module>:<Entity>:<family>`, e.g. `Eshop:Order:show`, without a leading colon.
protected
string
$key
= ''
IMPORTANT: key is a reserved sql word. Without a backtick-quoted name Doctrine generates
insert into … (key, …) and MariaDB rejects it (SyntaxErrorException #1064).
Attributes
- #[Column]
- $name: '`key`'
- $type: 'string'
- $length: 255
$module
protected
string
$module
= ''
Attributes
- #[Column]
- $name: 'module'
- $type: 'string'
- $length: 50
$sort
protected
int
$sort
= 0
Attributes
- #[Column]
- $name: 'sort'
- $type: 'integer'
$translations
protected
Collection
$translations
Attributes
- #[OneToMany]
- $targetEntity: \App\UI\Api\System\Models\Entities\PrivilegeGroupText::class
- $mappedBy: 'parent'
- $cascade: ['persist', 'remove']
- $orphanRemoval: true
- $fetch: 'LAZY'
Methods
__construct()
public
__construct([int|null $id = null ][, string $key = '' ][, string $module = '' ][, string $entity = '' ][, string $family = '' ][, int $sort = 0 ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $key : string = ''
- $module : string = ''
- $entity : string = ''
- $family : string = ''
- $sort : int = 0
- $translations : Collection = new ArrayCollection()
addTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thiscallInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getEntity()
public
getEntity() : string
Return values
stringgetFamily()
public
getFamily() : string
Return values
stringgetId()
public
getId() : int|null
Return values
int|nullgetKey()
public
getKey() : string
Return values
stringgetModule()
public
getModule() : string
Return values
stringgetSort()
public
getSort() : int
Return values
intgetTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>isPersisted()
public
isPersisted() : bool
Return values
boolremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetEntity()
public
setEntity(string $entity) : $this
Parameters
- $entity : string
Return values
$thissetFamily()
public
setFamily(string $family) : $this
Parameters
- $family : string
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetKey()
public
setKey(string $key) : $this
Parameters
- $key : string
Return values
$thissetModule()
public
setModule(string $module) : $this
Parameters
- $module : string
Return values
$thissetSort()
public
setSort(int $sort) : $this
Parameters
- $sort : int
Return values
$thissetTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thistranslationCollectionInit()
public
translationCollectionInit() : void
getTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>