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
$award
public
Award
$award
$award_id
public
int
$award_id
$branch
public
Branch
$branch
$branch_id
public
int|null
$branch_id
$call_into_court
public
string|null
$call_into_court
$close_reason
public
string|null
$close_reason
$contact_email
public
string|null
$contact_email
$contact_number
public
string
$contact_number
$court_availability
public
string|null
$court_availability
$created
public
DateTime
$created
$created_by
public
int|null
$created_by
$deleted
public
DateTime|null
$deleted
$event
public
Event
$event
$event_id
public
int|null
$event_id
$gathering_id
public
int|null
$gathering_id
$given
public
DateTime|null
$given
$id
public
int
$id
$member
public
Member
$member
$member_id
public
int|null
$member_id
$member_sca_name
public
string
$member_sca_name
$modified
public
DateTime|null
$modified
$modified_by
public
int|null
$modified_by
$person_to_notify
public
string|null
$person_to_notify
$reason
public
string|null
$reason
$requester
public
Member
$requester
$requester_id
public
int
$requester_id
$requester_sca_name
public
string
$requester_sca_name
$specialty
public
string|null
$specialty
$stack_rank
public
int|null
$stack_rank
$state
public
string
$state
$state_date
public
DateTime|null
$state_date
$status
public
string
$status
$_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
Return values
string —Validated state value