KMP PHP API Reference

Recommendation extends BaseEntity
in package

Recommendation Entity - Award recommendation workflow with state machine.

Implements dual status/state tracking:

  • Status: high-level category (In Progress, Scheduling, To Give, Closed)
  • State: specific workflow position within the status category

Table of Contents

Constants

GATHERING_ASSIGNABLE_STATES  = ['Need to Schedule', 'Scheduled', 'Given']
States that support assigning a scheduled gathering.

Properties

$award  : Award
$award_id  : int
$branch  : Branch
$branch_id  : int|null
$call_into_court  : string|null
$close_reason  : string|null
$contact_email  : string|null
$contact_number  : string
$court_availability  : string|null
$created  : DateTime
$created_by  : int|null
$deleted  : DateTime|null
$event  : Event
$event_id  : int|null
$gathering_id  : int|null
$given  : DateTime|null
$id  : int
$member  : Member
$member_id  : int|null
$member_sca_name  : string
$modified  : DateTime|null
$modified_by  : int|null
$person_to_notify  : string|null
$reason  : string|null
$requester  : Member
$requester_id  : int
$requester_sca_name  : string
$specialty  : string|null
$stack_rank  : int|null
$state  : string
$state_date  : DateTime|null
$status  : string
$_accessible  : array<string, bool>

Methods

getBranchId()  : int|null
Get the branch ID from the associated award.
getStates()  : array<string|int, mixed>
Get valid states, optionally filtered by status.
getStatuses()  : array<string|int, mixed>
Get status categories and their state mappings from configuration.
supportsGatheringAssignmentForState()  : bool
Determine whether a recommendation state supports a scheduled gathering assignment.
_setGiven()  : DateTime
Handle date format conversion for given date.
_setState()  : string
State machine setter - validates state and auto-updates status.

Constants

GATHERING_ASSIGNABLE_STATES

States that support assigning a scheduled gathering.

private mixed GATHERING_ASSIGNABLE_STATES = ['Need to Schedule', 'Scheduled', 'Given']

Properties

$_accessible

protected array<string, bool> $_accessible = [ 'requester_id' => true, 'stack_rank' => true, 'member_id' => true, 'branch_id' => true, 'award_id' => true, 'event_id' => true, // Deprecated - kept for migration compatibility, use gathering_id instead 'gathering_id' => true, 'given' => true, 'status' => true, 'state' => true, 'state_date' => true, 'stack_rank' => true, 'requester_sca_name' => true, 'member_sca_name' => true, 'contact_number' => true, 'contact_email' => true, 'reason' => true, 'specialty' => true, 'call_into_court' => true, 'court_availability' => true, 'modified' => true, 'created' => true, 'created_by' => true, 'modified_by' => true, 'deleted' => true, 'member' => true, 'events' => true, 'gatherings' => true, 'person_to_notify' => true, 'close_reason' => true, ]

Methods

getBranchId()

Get the branch ID from the associated award.

public getBranchId() : int|null
Return values
int|null

Branch ID or null if not determinable

getStates()

Get valid states, optionally filtered by status.

public static getStates([string|null $status = null ]) : array<string|int, mixed>
Parameters
$status : string|null = null

Optional status filter

Return values
array<string|int, mixed>

Valid states list

getStatuses()

Get status categories and their state mappings from configuration.

public static getStatuses() : array<string|int, mixed>
Return values
array<string|int, mixed>

Status configuration

supportsGatheringAssignmentForState()

Determine whether a recommendation state supports a scheduled gathering assignment.

public static supportsGatheringAssignmentForState(string $state) : bool
Parameters
$state : string

Workflow state name.

Return values
bool

_setGiven()

Handle date format conversion for given date.

protected _setGiven(mixed $value) : DateTime
Parameters
$value : mixed

Date value

Return values
DateTime

_setState()

State machine setter - validates state and auto-updates status.

protected _setState(string $value) : string

Applies configuration-driven state rules from Awards.RecommendationStateRules.

Parameters
$value : string

New state value

Tags
throws
InvalidArgumentException

When state is invalid

Return values
string

Validated state value


        
On this page

Search results