KMP PHP API Reference

RecommendationFormService
in package

Prepares lookup data for recommendation edit forms.

Centralises dropdown preparation used by the Turbo Frame templates.

Tags
see
RecommendationsController::turboEditForm()

Table of Contents

Properties

$statePolicyService  : RecommendationBestowalStatePolicyService

Methods

__construct()  : mixed
buildBranchesList()  : array<string|int, mixed>
Build the branches dropdown list.
buildStatusList()  : array<string, array<string, string>>
Build the status list formatted for dropdown display.
prepareEditFormData()  : array<string, mixed>
Prepare all view variables for a single-recommendation edit form (full or quick).

Properties

Methods

buildBranchesList()

Build the branches dropdown list.

public buildBranchesList(Table $awardsTable) : array<string|int, mixed>
Parameters
$awardsTable : Table

The Awards ORM table (must have Branches association).

Return values
array<string|int, mixed>

Branches list keyed by "id|can_have_members".

buildStatusList()

Build the status list formatted for dropdown display.

public buildStatusList([string|null $currentState = null ]) : array<string, array<string, string>>

Converts the entity's state/status map into a grouped array where each status key maps to an associative array of state => state.

Parameters
$currentState : string|null = null
Return values
array<string, array<string, string>>

Grouped status list.

prepareEditFormData()

Prepare all view variables for a single-recommendation edit form (full or quick).

public prepareEditFormData(Table $recommendationsTable, Recommendation $recommendation) : array<string, mixed>

Loads the lookup data needed by workflow-centric recommendation edit forms.

Parameters
$recommendationsTable : Table

The Recommendations ORM table.

$recommendation : Recommendation

The loaded recommendation entity (with contains).

Return values
array<string, mixed>

View variables expected by the edit templates.

On this page

Search results