Copied!

Role

Role.php : 11
Extends ValueObject

Base SPI Value object.

All properties of SPI\ValueObject must be serializable for cache & NoSQL use.

Constants

publicSTATUS_DEFINED

Role.php : 14
public int STATUS_DEFINED = 0

Status constant for defined (aka "published") role

publicSTATUS_DRAFT

Role.php : 17
public int STATUS_DRAFT = 1

Status constant for draft (aka "temporary") role

Properties

public $description

Role.php : 71

Name of the role.

public array<string|int, string> $description = []

public $id

Role.php : 24

ID of the user rule.

public mixed $id

public $identifier

Role.php : 44

Identifier of the role.

public string $identifier

Legacy note: Maps to name in 4.x.

public $name

Role.php : 62

Name of the role.

public array<string|int, string> $name

public $originalId

Role.php : 35

Only used when the role's status, is Role::STATUS_DRAFT.

public int|null $originalId

Original role ID the draft was created from, or -1 if it's a new role. Will be null if role's status is Role::STATUS_DEFINED.

public $policies

Role.php : 78

Policies associated with the role.

public array<string|int, Policy$policies = []

public $status

Role.php : 53

Status of the role (legacy: "version").

public int $status

One of Role::STATUS_DEFINED|Role::STATUS_DRAFT

Methods

public__construct()

ValueObject.php : 30

Construct object optionally with a set of properties.

public __construct([array<string|int, mixed> $properties = [] ])

Readonly properties values must be set using $properties as they are not writable anymore after object has been created.

Parameters

Name Type Default value Description
$properties array<string|int, mixed> [] -

protectedgetProperties()

ValueObject.php : 50

Function where list of properties are returned.

protected getProperties([array<string|int, mixed> $dynamicProperties = [] ]) : array<string|int, mixed>

Used by attributes(), override to add dynamic properties

Parameters

Name Type Default value Description
$dynamicProperties array<string|int, mixed> []

Additional dynamic properties exposed on the object

Return values

array<string|int, mixed>