UserRolePrivilege
extends UserRolePrivilege
in package
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_system_user_role_privileges'
- #[TableAlias]
- 'userRolePrivilege'
Table of Contents
Properties
- $branch : string
- Root branch of the key (`:Admin` / `:Front` / `:Api`). Badge and filter in the admin; existing keys keep `Admin` (the default).
- $groupKey : string|null
- Group key shown in the list; not a column. `UserRolePrivilegeGridService` fills it from the join in Api `findPrivileges()`.
- $id : int|null
- $key : string|null
- $name : string|null
- Privilege name in the current admin language; not a column, the ORM `translations` collection is not loaded here (raw SQL path). `UserRolePrivilegeGridService` fills it from `UserRolePrivilegeMatrixManager::namesForPrivileges()` (left join of `cms_system_user_role_privilege_texts` with fallback to the default language).
- $privilegeGroupId : int|null
- Functional group: purely presentational, not an authorization node. `null` means "unassigned"; the privilege is enforced the same way anyway.
- $sort : int
- Order within the group (Multiplier).
- $translations : Collection
- Privilege labels.
- $userRoleRels : Collection<int, UserRolePrivilegeRel>
- Role links (RBAC matrix): the cell of a list row. Filled set-based by {@see \App\UI\Admin\System\Models\Helpers\UserRolePrivilegeGridService}, not by Doctrine one-to-many (the join table has a derived identity, which the ORM deliberately avoids).
Methods
- __construct() : mixed
- addTranslation() : $this
- addUserRoleRel() : self
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- clearUserRoleRels() : self
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getBranch() : string
- getGroupKey() : string|null
- getId() : int|null
- getKey() : string|null
- getName() : string|null
- getPrivilegeGroupId() : int|null
- getSort() : int
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- getUserRoleRels() : Collection<int, UserRolePrivilegeRel>
- isPersisted() : bool
- removeTranslation() : $this
- setBranch() : $this
- setGroupKey() : self
- setId() : $this
- setKey() : $this
- setName() : self
- setPrivilegeGroupId() : $this
- setSort() : $this
- setTranslations() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$branch
Root branch of the key (`:Admin` / `:Front` / `:Api`). Badge and filter in the admin; existing keys keep `Admin` (the default).
protected
string
$branch
= 'Admin'
Attributes
- #[Column]
- $type: "string"
- $length: 10
$groupKey
Group key shown in the list; not a column. `UserRolePrivilegeGridService` fills it from the join in Api `findPrivileges()`.
protected
string|null
$groupKey
= null
Attributes
- #[Transient]
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $type: "integer"
- $name: "user_role_privilege_id"
- #[GeneratedValue]
- #[Id]
$key
protected
string|null
$key
= null
Attributes
- #[Column]
- $type: "string"
- $length: 255
- $name: "`key`"
- $nullable: true
$name
Privilege name in the current admin language; not a column, the ORM `translations` collection is not loaded here (raw SQL path). `UserRolePrivilegeGridService` fills it from `UserRolePrivilegeMatrixManager::namesForPrivileges()` (left join of `cms_system_user_role_privilege_texts` with fallback to the default language).
protected
string|null
$name
= null
Read-only in the grid; names have no CRUD here (see UserRolePrivilegeText).
Attributes
- #[Transient]
$privilegeGroupId
Functional group: purely presentational, not an authorization node. `null` means "unassigned"; the privilege is enforced the same way anyway.
protected
int|null
$privilegeGroupId
= null
Attributes
- #[Column]
- $name: 'cms_system_privilege_groups_privilege_group_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$sort
Order within the group (Multiplier).
protected
int
$sort
= 0
Attributes
- #[Column]
- $type: "integer"
$translations
Privilege labels.
protected
Collection
$translations
Attributes
- #[CollectionOf]
- \App\UI\Admin\System\Models\Entities\UserRolePrivilegeText::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Admin\System\Models\Entities\UserRolePrivilegeText::class
- $mappedBy: 'parent'
- $cascade: ['persist', 'remove']
- $orphanRemoval: true
- $fetch: 'LAZY'
$userRoleRels
Role links (RBAC matrix): the cell of a list row. Filled set-based by {@see \App\UI\Admin\System\Models\Helpers\UserRolePrivilegeGridService}, not by Doctrine one-to-many (the join table has a derived identity, which the ORM deliberately avoids).
protected
Collection<int, UserRolePrivilegeRel>
$userRoleRels
The DataGrid reads it via RelationColumn.
Attributes
- #[CollectionOf]
- \App\UI\Admin\System\Models\Entities\UserRolePrivilegeRel::class
Methods
__construct()
public
__construct([int|null $id = null ][, string|null $key = null ][, string $branch = 'Admin' ][, int $sort = 0 ][, int|null $privilegeGroupId = null ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $key : string|null = null
- $branch : string = 'Admin'
- $sort : int = 0
- $privilegeGroupId : int|null = null
- $translations : Collection = new ArrayCollection()
addTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thisaddUserRoleRel()
public
addUserRoleRel(UserRolePrivilegeRel $rel) : self
Parameters
- $rel : UserRolePrivilegeRel
Return values
selfcallInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
clearUserRoleRels()
public
clearUserRoleRels() : self
Return values
selfgetAllTraits()
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>getBranch()
public
getBranch() : string
Return values
stringgetGroupKey()
public
getGroupKey() : string|null
Return values
string|nullgetId()
public
getId() : int|null
Return values
int|nullgetKey()
public
getKey() : string|null
Return values
string|nullgetName()
public
getName() : string|null
Return values
string|nullgetPrivilegeGroupId()
public
getPrivilegeGroupId() : int|null
Return values
int|nullgetSort()
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>getUserRoleRels()
public
getUserRoleRels() : Collection<int, UserRolePrivilegeRel>
Return values
Collection<int, UserRolePrivilegeRel>isPersisted()
public
isPersisted() : bool
Return values
boolremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetBranch()
public
setBranch(string $branch) : $this
Parameters
- $branch : string
Return values
$thissetGroupKey()
public
setGroupKey(string|null $groupKey) : self
Parameters
- $groupKey : string|null
Return values
selfsetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetKey()
public
setKey(string|null $key) : $this
Parameters
- $key : string|null
Return values
$thissetName()
public
setName(string|null $name) : self
Parameters
- $name : string|null
Return values
selfsetPrivilegeGroupId()
public
setPrivilegeGroupId(int|null $privilegeGroupId) : $this
Parameters
- $privilegeGroupId : int|null
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>