KMP PHP API Reference

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

Properties

$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
bool

getBranchId()

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
Return values
string

        
On this page

Search results