RecommendationUpdateService
in package
uses
RecommendationMutationSupportTrait
Table of Contents
Properties
Methods
- __construct() : mixed
- update() : array<string, mixed>
- applyCourtPreferenceDefaults() : void
- Apply legacy fallback defaults for court-preference fields.
- buildOutputData() : array<string, mixed>
- detectAwardWorkflowChange() : array{requiresConfirmation: bool, currentApprovalProcessId: ?int, newApprovalProcessId: ?int}
- extractGatheringIds() : array<string|int, int>
- formatGivenDate() : string|null
- Format stored "given" timestamps back to a stable UTC date-only value.
- hydrateMemberDefaults() : void
- Hydrate branch and court-preference defaults from the selected member.
- initializeSubmissionState() : void
- Apply the legacy initial status/state pair used by recommendation submission.
- normalizeCheckboxValue() : bool
- Normalize checkbox-style request values to booleans.
- normalizeOptionalInteger() : int|null
- Convert positive numeric form values to integers.
- normalizeSpecialty() : void
- Convert the placeholder specialty option into a null database value.
-
resolveMemberPublicId()
: array{success: bool, data: array
, errorCode: ?string, message: ?string}
Properties
$approvalLifecycleService
private
RecommendationApprovalWorkflowLifecycleService
$approvalLifecycleService
Methods
__construct()
public
__construct([RecommendationApprovalWorkflowLifecycleService|null $approvalLifecycleService = null ]) : mixed
Parameters
- $approvalLifecycleService : RecommendationApprovalWorkflowLifecycleService|null = null
-
Optional lifecycle service.
update()
public
update(RecommendationsTable $recommendationsTable, Recommendation $recommendation, array<string, mixed> $data, int $authorId) : array<string, mixed>
Parameters
- $recommendationsTable : RecommendationsTable
- $recommendation : Recommendation
- $data : array<string, mixed>
- $authorId : int
Return values
array<string, mixed>applyCourtPreferenceDefaults()
Apply legacy fallback defaults for court-preference fields.
private
applyCourtPreferenceDefaults(Recommendation $recommendation) : void
Parameters
- $recommendation : Recommendation
-
Recommendation being normalized.
buildOutputData()
private
buildOutputData(RecommendationsTable $recommendationsTable, Recommendation $recommendation[, array<string, mixed> $extra = [] ]) : array<string, mixed>
Parameters
- $recommendationsTable : RecommendationsTable
- $recommendation : Recommendation
- $extra : array<string, mixed> = []
Return values
array<string, mixed>detectAwardWorkflowChange()
private
detectAwardWorkflowChange(RecommendationsTable $recommendationsTable, Recommendation $recommendation, array<string, mixed> $workingData) : array{requiresConfirmation: bool, currentApprovalProcessId: ?int, newApprovalProcessId: ?int}
Parameters
- $recommendationsTable : RecommendationsTable
- $recommendation : Recommendation
- $workingData : array<string, mixed>
Return values
array{requiresConfirmation: bool, currentApprovalProcessId: ?int, newApprovalProcessId: ?int}extractGatheringIds()
private
extractGatheringIds(Recommendation $recommendation) : array<string|int, int>
Parameters
- $recommendation : Recommendation
Return values
array<string|int, int>formatGivenDate()
Format stored "given" timestamps back to a stable UTC date-only value.
private
formatGivenDate(DateTimeInterface|null $given) : string|null
Parameters
- $given : DateTimeInterface|null
-
Stored given timestamp.
Return values
string|nullhydrateMemberDefaults()
Hydrate branch and court-preference defaults from the selected member.
private
hydrateMemberDefaults(RecommendationsTable $recommendationsTable, Recommendation $recommendation) : void
Parameters
- $recommendationsTable : RecommendationsTable
-
Recommendations table.
- $recommendation : Recommendation
-
Recommendation being normalized.
initializeSubmissionState()
Apply the legacy initial status/state pair used by recommendation submission.
private
initializeSubmissionState(Recommendation $recommendation) : void
Parameters
- $recommendation : Recommendation
-
Recommendation being initialized.
normalizeCheckboxValue()
Normalize checkbox-style request values to booleans.
private
normalizeCheckboxValue(mixed $value) : bool
Parameters
- $value : mixed
-
Request value to normalize.
Return values
boolnormalizeOptionalInteger()
Convert positive numeric form values to integers.
private
normalizeOptionalInteger(mixed $value) : int|null
Parameters
- $value : mixed
Return values
int|nullnormalizeSpecialty()
Convert the placeholder specialty option into a null database value.
private
normalizeSpecialty(Recommendation $recommendation) : void
Parameters
- $recommendation : Recommendation
-
Recommendation being normalized.
resolveMemberPublicId()
private
resolveMemberPublicId(RecommendationsTable $recommendationsTable, array<string, mixed> $data) : array{success: bool, data: array, errorCode: ?string, message: ?string}
Parameters
- $recommendationsTable : RecommendationsTable
- $data : array<string, mixed>