class RolePermissionsRepository extends EntityRepository

Class RolePermissionsRepository is injected as user_plugin.role_permissions.repository service. RolePermissionsRepository is used for crud operation for entity.

Use this class to work with database.

Constants

ALIAS

Alias for main entity

ROLE_ALIAS

Alias for role

Methods

getRolePermissionsObjForRoleId(mixed $roleId)

Get role permission for role id

array|null
getPermissionsForRoleId(mixed $roleId)

Get array of permissions for role id

save(RolePermissions $entity)

Save RolePermissions

edit(RolePermissions $entity)

Mege RolePermissions

bool
remove(RolePermissions $entity)

Remove single role permission

mixed
getReferenceByClass(string $class, int $id)

Get refference to class

array
getPermissionsForRoles()

Get role and its permissions

Details

at line 42
RolePermissions|null getRolePermissionsObjForRoleId(mixed $roleId)

Get role permission for role id

Parameters

mixed $roleId

Return Value

RolePermissions|null

Exceptions

NonUniqueResultException

at line 60
array|null getPermissionsForRoleId(mixed $roleId)

Get array of permissions for role id

Parameters

mixed $roleId

Return Value

array|null

Exceptions

NonUniqueResultException

at line 77
bool|RolePermissions save(RolePermissions $entity)

Save RolePermissions

Parameters

RolePermissions $entity

Return Value

bool|RolePermissions

at line 95
bool|RolePermissions edit(RolePermissions $entity)

Mege RolePermissions

Parameters

RolePermissions $entity

Return Value

bool|RolePermissions

at line 113
bool remove(RolePermissions $entity)

Remove single role permission

Parameters

RolePermissions $entity

Return Value

bool

at line 132
mixed getReferenceByClass(string $class, int $id)

Get refference to class

Parameters

string $class
int $id

Return Value

mixed

at line 145
array getPermissionsForRoles()

Get role and its permissions

Return Value

array