ServicePrincipalRole
extends ActiveWindowBaseEntity
in package
ServicePrincipalRole Entity - Role Assignment for Service Principals
Mirrors MemberRole structure to enable RBAC for API clients.
Table of Contents
Constants
- CANCELLED_STATUS = 'Cancelled'
- CURRENT_STATUS = 'Current'
- DEACTIVATED_STATUS = 'Deactivated'
- EXPIRED_STATUS = 'Expired'
- RELEASED_STATUS = 'Released'
- REPLACED_STATUS = 'Replaced'
- UPCOMING_STATUS = 'Upcoming'
Properties
- $approved_by : Member|null
- $approver_id : int|null
- $branch : Branch|null
- $branch_id : int|null
- $created : DateTime
- $entity_id : int|null
- $entity_type : string|null
- $expires_on : Date|null
- $id : int
- $member_id : int
- $modified : DateTime
- $revoked_by : Member|null
- $revoked_on : DateTime|null
- $revoked_reason : string|null
- $revoker_id : int|null
- $role : Role
- $role_id : int
- $service_principal : ServicePrincipal
- $service_principal_id : int
- $start_on : Date
- $status : string
- $typeIdField : array<string|int, mixed>
- $_accessible : array<string, bool>
- Fields accessible for mass assignment.
Methods
- expire() : bool
- Stops an active window for an entity - save your entity after calling
- getBranchId() : int|null
- Get the branch ID for authorization checks.
- start() : bool
- Starts an active window for an entity - save your entity after calling
- _getExpiresOnToString() : string
- Format expiration date for display.
- _getGrantedBy() : string
- Get the granting entity description.
- _getStartOnToString() : string
- Format start date for display.
Constants
CANCELLED_STATUS
public
mixed
CANCELLED_STATUS
= 'Cancelled'
CURRENT_STATUS
public
mixed
CURRENT_STATUS
= 'Current'
DEACTIVATED_STATUS
public
mixed
DEACTIVATED_STATUS
= 'Deactivated'
EXPIRED_STATUS
public
mixed
EXPIRED_STATUS
= 'Expired'
RELEASED_STATUS
public
mixed
RELEASED_STATUS
= 'Released'
REPLACED_STATUS
public
mixed
REPLACED_STATUS
= 'Replaced'
UPCOMING_STATUS
public
mixed
UPCOMING_STATUS
= 'Upcoming'
Properties
$approved_by
public
Member|null
$approved_by
$approver_id
public
int|null
$approver_id
$branch
public
Branch|null
$branch
$branch_id
public
int|null
$branch_id
$created
public
DateTime
$created
$entity_id
public
int|null
$entity_id
$entity_type
public
string|null
$entity_type
$expires_on
public
Date|null
$expires_on
$id
public
int
$id
$member_id
public
int
$member_id
$modified
public
DateTime
$modified
$revoked_by
public
Member|null
$revoked_by
$revoked_on
public
DateTime|null
$revoked_on
$revoked_reason
public
string|null
$revoked_reason
$revoker_id
public
int|null
$revoker_id
$role
public
Role
$role
$role_id
public
int
$role_id
$service_principal
public
ServicePrincipal
$service_principal
$service_principal_id
public
int
$service_principal_id
$start_on
public
Date
$start_on
$status
public
string
$status
$typeIdField
public
array<string|int, mixed>
$typeIdField
= ['role_id', 'service_principal_id']
Field combination for type identification
$_accessible
Fields accessible for mass assignment.
protected
array<string, bool>
$_accessible
= ['service_principal_id' => true, 'role_id' => true, 'branch_id' => true, 'start_on' => true, 'expires_on' => true, 'entity_type' => true, 'entity_id' => true, 'approver_id' => true, 'revoked_on' => true, 'revoker_id' => true, 'service_principal' => true, 'role' => true, 'branch' => true, 'approved_by' => true, 'revoked_by' => true]
Methods
expire()
Stops an active window for an entity - save your entity after calling
public
expire([Datetime $expiresOn = null ]) : bool
Parameters
- $expiresOn : Datetime = null
Return values
boolgetBranchId()
Get the branch ID for authorization checks.
public
getBranchId() : int|null
Child classes should override for complex branch relationships.
Return values
int|null —The branch ID, or null if no association
start()
Starts an active window for an entity - save your entity after calling
public
start([Datetime|null $startOn = null ][, Datetime|null $expiresOn = null ][, int|null $termYears = null ]) : bool
Parameters
- $startOn : Datetime|null = null
- $expiresOn : Datetime|null = null
- $termYears : int|null = null
Return values
bool_getExpiresOnToString()
Format expiration date for display.
protected
_getExpiresOnToString() : string
Return values
string_getGrantedBy()
Get the granting entity description.
protected
_getGrantedBy(mixed $value) : string
Parameters
- $value : mixed
Return values
string_getStartOnToString()
Format start date for display.
protected
_getStartOnToString() : string