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
Tags
see
AuthorizationsTable

Table class

https://github.com/Ansteorra/KMP/blob/main/docs/5.6.7-authorization-entity-reference.md

Complete documentation

Table of Contents

Constants

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

Properties

$activity  : Activity
$activity_id  : int
$approval_count  : int
$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
Resolve branch scope through the authorized member.
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]

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()

Resolve branch scope through the authorized member.

public getBranchId() : int
Return values
int

Branch ID or a deny-only sentinel when not determinable

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