KMP PHP API Reference

Authorization extends ActiveWindowBaseEntity
in package

Authorization Entity

Represents a member's authorization to participate in a specific activity. Extends ActiveWindowBaseEntity for automatic temporal lifecycle management. Tracks approval workflow state, expiration dates, and role assignments.

Status Constants: APPROVED_STATUS, PENDING_STATUS, DENIED_STATUS, REVOKED_STATUS, EXPIRED_STATUS, RETRACTED_STATUS

Database Fields:

  • member_id, activity_id, expires_on, start_on, status, approval_count
  • granted_member_role_id, revoker_id, revoked_reason, is_renewal

Relationships:

  • belongsTo Member, Activity, MemberRole (granted_member_role_id)
  • belongsTo RevokedBy (revoker_id) - who revoked
  • hasMany AuthorizationApprovals - workflow tracking
Tags
see
AuthorizationsTable

Table class

see

5.6.7-authorization-entity-reference.md Complete documentation

Table of Contents

Constants

APPROVED_STATUS  = "Approved"
CANCELLED_STATUS  = 'Cancelled'
CURRENT_STATUS  = 'Current'
DEACTIVATED_STATUS  = 'Deactivated'
DENIED_STATUS  = "Denied"
EXPIRED_STATUS  = "Expired"
PENDING_STATUS  = "Pending"
RELEASED_STATUS  = 'Released'
REPLACED_STATUS  = 'Replaced'
RETRACTED_STATUS  = "Retracted"
REVOKED_STATUS  = "Revoked"
UPCOMING_STATUS  = 'Upcoming'

Properties

$activity  : Activity
$activity_id  : int
$approval_count  : int
$authorization_approvals  : array<string|int, AuthorizationApproval>
$branch_id  : int|null
$created  : DateTime
$expires_on  : DateTime|null
$granted_member_role_id  : int|null
$id  : int
$is_renewal  : bool
$member  : Member
$member_id  : int
$member_role  : MemberRole
$modified  : DateTime|null
$revoked_by  : Member
$revoked_reason  : string
$revoker_id  : int|null
$start_on  : DateTime|null
$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()  : mixed
Get the expires on to string virtual field.
_getStartOnToString()  : mixed
Get the start on to string virtual field.

Constants

RETRACTED_STATUS

public mixed RETRACTED_STATUS = "Retracted"

Properties

$branch_id

public int|null $branch_id

Associated branch ID (when applicable)

$granted_member_role_id

public int|null $granted_member_role_id

$modified

public DateTime|null $modified

Last modification timestamp

$typeIdField

public array<string|int, mixed> $typeIdField = ['activity_id', 'member_id']

$_accessible

Fields that can be mass assigned using newEntity() or patchEntity().

protected array<string, bool> $_accessible = ["member_id" => true, "activity_id" => true, "expires_on" => true, "start_on" => true, "member" => true, "activity" => true, "authorization_approvals" => 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
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()

Get the expires on to string virtual field.

protected _getExpiresOnToString() : mixed

_getStartOnToString()

Get the start on to string virtual field.

protected _getStartOnToString() : mixed

        
On this page

Search results