MemberRole
extends ActiveWindowBaseEntity
in package
MemberRole Entity
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
- $approver_id : int
- $branch_id : int|null
- $created : DateTime|null
- $expires_on : Date|null
- $id : int
- $Member : Member
- $member_id : int
- $Member_id : int
- $modified : DateTime|null
- $revoked_reason : string|null
- $revoker_id : int|null
- $role : Role
- $role_id : int
- $start_on : Date
- $status : string
- $typeIdField : array<string|int, mixed>
- $_accessible : array<string, bool>
- Fields that can be mass assigned using newEntity() or patchEntity().
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
- Virtual field for timezone-aware expires_on date display
- _getGrantedBy() : mixed
- Get the granted by virtual field.
- _getStartOnToString() : string
- Virtual field for timezone-aware start_on date 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
$approved_by
$approver_id
public
int
$approver_id
$branch_id
public
int|null
$branch_id
Associated branch ID (when applicable)
$created
public
DateTime|null
$created
Creation timestamp
$expires_on
public
Date|null
$expires_on
$id
public
int
$id
$Member
public
Member
$Member
$member_id
public
int
$member_id
$Member_id
public
int
$Member_id
$modified
public
DateTime|null
$modified
Last modification timestamp
$revoked_reason
public
string|null
$revoked_reason
$revoker_id
public
int|null
$revoker_id
$role
public
Role
$role
$role_id
public
int
$role_id
$start_on
public
Date
$start_on
$status
public
string
$status
$typeIdField
public
array<string|int, mixed>
$typeIdField
= ['role_id', 'member_id']
$_accessible
Fields that can be mass assigned using newEntity() or patchEntity().
protected
array<string, bool>
$_accessible
= ['Member_id' => true, 'role_id' => true, 'expires_on' => true, 'start_on' => true, 'approver_id' => true, 'revoker_id' => true, 'Member' => true, 'role' => true, 'approved_by' => true, 'branch_id' => true]
Note that when '' is set to true, this allows all unspecified fields to be mass assigned. For security purposes, it is advised to set '' to false (or remove it), and explicitly make individual fields accessible as needed.
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()
Virtual field for timezone-aware expires_on date display
protected
_getExpiresOnToString() : string
Return values
string —Formatted expiration date using kingdom default timezone
_getGrantedBy()
Get the granted by virtual field.
protected
_getGrantedBy(mixed $value) : mixed
Parameters
- $value : mixed
_getStartOnToString()
Virtual field for timezone-aware start_on date display
protected
_getStartOnToString() : string
Return values
string —Formatted start date using kingdom default timezone