KMP PHP API Reference

Officer extends ActiveWindowBaseEntity
in package

Officer Entity - Officer assignments with temporal management

Represents individual officer assignments extending ActiveWindowBaseEntity for automatic temporal status transitions, warrant integration, and hierarchical reporting.

Tags
see

/docs/5.1-officers-plugin.md

see
OfficersTable

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

$branch  : Branch
$branch_id  : int
$created  : DateTime
$current_warrant  : Warrant
$deputy_description  : string|null
$deputy_to_branch_id  : int|null
$deputy_to_currently  : array<string|int, Officer>
$deputy_to_office_id  : int|null
$effective_reports_to_currently  : array<string|int, mixed>
$email_address  : string
$expires_on  : Date|null
$granted_member_role  : Role
$granted_member_role_id  : int|null
$id  : int
$is_editable  : bool
$member  : Member
$member_id  : int
$modified  : DateTime
$office  : Office
$office_id  : int
$pending_warrants  : array<string|int, Warrant>
$reports_to_currently  : array<string|int, Officer>
$reports_to_list  : string
$revoked_reason  : string|null
$revoker_id  : int|null
$start_on  : Date|null
$status  : string
$typeIdField  : array<string|int, mixed>
Type identification fields for ActiveWindow behavior.
$warrant_state  : string
$_accessible  : array<string, bool>
Fields that can be mass assigned.

Methods

_getReportsToList()  : string
Get formatted string of officers this position reports to with mailto links.
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
_getEffectiveReportsToCurrently()  : array<string|int, Officer>
Resolve effective officers this assignment reports to using skip-aware hierarchy.
_getExpiresOnToString()  : mixed
Get the expires on to string virtual field.
_getIsEditable()  : bool
Determine if assignment can be edited (deputy positions or those with email).
_getStartOnToString()  : mixed
Get the start on to string virtual field.
_getWarrantState()  : string
Calculate warrant state based on office requirements and active warrants.

Constants

Properties

$branch_id

public int $branch_id

Foreign key to branch

$created

public DateTime $created

Record creation timestamp

$deputy_description

public string|null $deputy_description

Custom description for deputy assignments

$deputy_to_branch_id

public int|null $deputy_to_branch_id

Foreign key for cross-branch deputy

$deputy_to_currently

public array<string|int, Officer> $deputy_to_currently

$deputy_to_office_id

public int|null $deputy_to_office_id

Foreign key for deputy office

$effective_reports_to_currently

public array<string|int, mixed> $effective_reports_to_currently

Virtual: skip-aware hierarchy traversal

$email_address

public string $email_address

Officer contact email

$expires_on

public Date|null $expires_on

Assignment expiration date

$granted_member_role_id

public int|null $granted_member_role_id

Foreign key to granted role

$is_editable

public bool $is_editable

Virtual: whether assignment can be edited

$member_id

public int $member_id

Foreign key to assigned member

$modified

public DateTime $modified

Last modification timestamp

$office_id

public int $office_id

Foreign key to office

$reports_to_currently

public array<string|int, Officer> $reports_to_currently

$reports_to_list

public string $reports_to_list

Virtual: formatted reporting hierarchy

$revoked_reason

public string|null $revoked_reason

Reason for revocation

$revoker_id

public int|null $revoker_id

User who revoked

$start_on

public Date|null $start_on

Assignment start date

$status

public string $status

Assignment status (new, current, upcoming, expired, revoked)

$typeIdField

Type identification fields for ActiveWindow behavior.

public array<string|int, mixed> $typeIdField = ['office_id', 'branch_id']

Composite key enables temporal management per office per branch.

$warrant_state

public string $warrant_state

Virtual: Active, Pending, Missing, Not Required

$_accessible

Fields that can be mass assigned.

protected array<string, bool> $_accessible = ['member_id' => true, 'branch_id' => true, 'office_id' => true, 'granted_member_role_id' => true, 'expires_on' => true, 'start_on' => true, 'status' => true, 'revoked_reason' => true, 'revoker_id' => true, 'approver_id' => true, 'approval_date' => true, 'reports_to_office_id' => true, 'reports_to_branch_id' => true, 'deputy_to_office_id' => true, 'deputy_to_branch_id' => true, 'member' => true, 'branch' => true, 'office' => true, 'deputy_description' => true, 'email_address' => true]

Methods

_getReportsToList()

Get formatted string of officers this position reports to with mailto links.

public _getReportsToList() : string

Uses skip-aware hierarchy traversal when intermediate offices are vacant.

Return values
string

"Society", "Not Filled", or comma-separated list with links

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

_getEffectiveReportsToCurrently()

Resolve effective officers this assignment reports to using skip-aware hierarchy.

protected _getEffectiveReportsToCurrently() : array<string|int, Officer>

Traverses reporting chain honoring can_skip_report flag when offices are vacant.

Return values
array<string|int, Officer>

_getExpiresOnToString()

Get the expires on to string virtual field.

protected _getExpiresOnToString() : mixed

_getIsEditable()

Determine if assignment can be edited (deputy positions or those with email).

protected _getIsEditable() : bool
Return values
bool

_getStartOnToString()

Get the start on to string virtual field.

protected _getStartOnToString() : mixed

_getWarrantState()

Calculate warrant state based on office requirements and active warrants.

protected _getWarrantState(mixed $value) : string
Parameters
$value : mixed

Unused

Return values
string

One of: Active, Pending, Missing, Not Required, Can Not Calculate


        
On this page

Search results