Copied!

Role

Role.php : 12
Extends ValueObject

Base SPI Value object.

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

Constants

publicSTATUS_DEFINED

Role.php : 15
public int STATUS_DEFINED = 0

Status constant for defined (aka "published") role

publicSTATUS_DRAFT

Role.php : 18
public int STATUS_DRAFT = 1

Status constant for draft (aka "temporary") role

Properties

public $description

Role.php : 72

Name of the role.

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

public $id

Role.php : 25

ID of the user rule.

public mixed $id

public $identifier

Role.php : 45

Identifier of the role.

public string $identifier

Legacy note: Maps to name in 4.x.

public $name

Role.php : 63

Name of the role.

public array<string|int, string> $name

public $originalId

Role.php : 36

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 : 79

Policies associated with the role.

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

public $status

Role.php : 54

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

public int $status

One of Role::STATUS_DEFINED|Role::STATUS_DRAFT

Methods

public__construct()

ValueObject.php : 32

Construct object optionally with a set of properties.

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

Readonly properties values must be set using $properties as they aren't writable anymore after object has been created.

Parameters

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

protectedgetProperties()

ValueObject.php : 53

Returns list of available properties' names.

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

Override to add dynamic properties.

Parameters

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

Additional dynamic properties exposed on the object

Return values

array<int, string>

Attributes
#[Ignore]