Menu

## Actor
in package

Actor.php : 15

This abtract class provides functionality for user entities that crates might want to implement, such as permissions.

### Table of Contents

$permissionIdToAssociation : array<string|int, mixed>
addPermission() : mixed
  Associates a permission with this actor in a given state. For permission manipulation, use only the PermissionManager class.
getPermission() : PermissionAssociationInterface
  Returns the associated permission given by an id. For permission checking, use only the PermissionManager class.
getRawPermission() : Permission
  Returns the raw permission given by the id. For permission checking, use only the PermissionManager class.
hasPermissionSet() : bool
  Checks if the actor is associated with a given permission. For permission checking, use only the PermissionManager class.
removePermission() : mixed
  Removes an associated permission from this actor by a given id. For permission manipulation, use only the PermissionManager class.
getPermissionAssociationClass() : string
  Returns the class of the permission associations used for the entity implementing this class.
getPermissionAssociations() : Generator
  Needs to return a generator which iterates through all permission associations.
loadPermissions() : mixed
  Loads all associated permissions for this actor.

### Properties

#### $permissionIdToAssociation

Actor.php : 18
`private array<string|int, mixed> $permissionIdToAssociation = []`

Associations between permission-id and PermissionAssociation entity.

### Methods

#### addPermission()

Actor.php : 98

Associates a permission with this actor in a given state. For permission manipulation, use only the PermissionManager class.

`public addPermission(Permission $permission, int $state) : mixed`

##### Parameters

$permission : Permission
$state : int

##### Tags

throws
  PermissionAlreadyExistsException

##### Return values

mixed —

#### getPermission()

Actor.php : 71

Returns the associated permission given by an id. For permission checking, use only the PermissionManager class.

`public getPermission(string $permissionId) : PermissionAssociationInterface`

##### Parameters

$permissionId : string

##### Return values

PermissionAssociationInterface —

#### getRawPermission()

Actor.php : 84

Returns the raw permission given by the id. For permission checking, use only the PermissionManager class.

`public getRawPermission(string $permissionId) : Permission`

##### Parameters

$permissionId : string

##### Return values

Permission —

#### hasPermissionSet()

Actor.php : 58

Checks if the actor is associated with a given permission. For permission checking, use only the PermissionManager class.

`public hasPermissionSet(string $permissionId) : bool`

##### Parameters

$permissionId : string

##### Return values

bool —

#### removePermission()

Actor.php : 119

Removes an associated permission from this actor by a given id. For permission manipulation, use only the PermissionManager class.

`public removePermission(string $permissionId) : mixed`

##### Parameters

$permissionId : string

##### Tags

throws
  PermissionDoesNotExistException

##### Return values

mixed —

#### getPermissionAssociationClass()

Actor.php : 31

Returns the class of the permission associations used for the entity implementing this class.

`protected abstract getPermissionAssociationClass() : string`

##### Return values

string —

fully qualified class name of the permission association entity.

#### getPermissionAssociations()

Actor.php : 24

Needs to return a generator which iterates through all permission associations.

`protected abstract getPermissionAssociations() : Generator`

##### Return values

Generator —

List of PermissionAssociations.

#### loadPermissions()

Actor.php : 37

Loads all associated permissions for this actor.

`protected loadPermissions() : mixed`

##### Tags

throws
  PermissionAssociationEntityMissingException

##### Return values

mixed —

## Search results