BestowalGatheringLookupService
in package
uses
LocatorAwareTrait
Resolves gathering options for bestowal edit forms with member attendance markers.
Table of Contents
Methods
-
getFilteredGatheringsForBestowal()
: array{gatherings: array
, cancelledGatheringIds: array , rankedGatherings: array >} - Build gathering options for a single bestowal edit form.
-
getFilteredGatheringsForBestowalIds()
: array{gatherings: array
, cancelledGatheringIds: array , rankedGatherings: array >} - Build gathering options for bulk bestowal edit across multiple bestowals.
- getMemberAttendanceGatherings() : array<int, Gathering>
- Gatherings the member marked as likely attendance shared with crown/kingdom.
- isGatheringSelectableForBestowal() : bool
- Validate a submitted gathering without treating the submitted value as a sticky option.
- buildAttendanceMap() : array<int, bool|int>
-
buildGatheringOptions()
: array{gatherings: array
, cancelledGatheringIds: array , rankedGatherings: array >} - buildRankedGatheringItem() : array<string, mixed>
- buildSuggestedGatheringMap() : array<int, int>
- collectAwardIdsFromBestowal() : array<string|int, int>
- collectRecommendationIdsFromBestowal() : array<string|int, int>
- fetchGatheringsQuery() : SelectQuery
- formatGatheringLabel() : string
- groupRankedGatherings() : array<int, array<string, mixed>>
- resolveCommonActivityIds() : array<string|int, int>
- resolveGatheringIdsSupportingAllAwards() : array<string|int, int>
Methods
getFilteredGatheringsForBestowal()
Build gathering options for a single bestowal edit form.
public
getFilteredGatheringsForBestowal(Bestowal $bestowal[, bool $futureOnly = true ][, int|null $selectedGatheringId = null ][, int|null $awardIdOverride = null ]) : array{gatherings: array, cancelledGatheringIds: array, rankedGatherings: array>}
Parameters
- $bestowal : Bestowal
-
Loaded bestowal with recommendations contain.
- $futureOnly : bool = true
-
When true, only include future gatherings.
- $selectedGatheringId : int|null = null
-
Currently selected gathering to always include.
- $awardIdOverride : int|null = null
Return values
array{gatherings: arraygetFilteredGatheringsForBestowalIds()
Build gathering options for bulk bestowal edit across multiple bestowals.
public
getFilteredGatheringsForBestowalIds(array<string|int, int> $bestowalIds[, bool $futureOnly = true ][, int|null $selectedGatheringId = null ]) : array{gatherings: array, cancelledGatheringIds: array, rankedGatherings: array>}
Parameters
- $bestowalIds : array<string|int, int>
-
Selected bestowal IDs.
- $futureOnly : bool = true
-
When true, only include future gatherings.
- $selectedGatheringId : int|null = null
-
Currently selected gathering to always include.
Return values
array{gatherings: arraygetMemberAttendanceGatherings()
Gatherings the member marked as likely attendance shared with crown/kingdom.
public
getMemberAttendanceGatherings(int $memberId) : array<int, Gathering>
Parameters
- $memberId : int
-
Member ID.
Return values
array<int, Gathering>isGatheringSelectableForBestowal()
Validate a submitted gathering without treating the submitted value as a sticky option.
public
isGatheringSelectableForBestowal(Bestowal $bestowal, int $gatheringId[, bool $futureOnly = true ]) : bool
Parameters
- $bestowal : Bestowal
-
Loaded bestowal with recommendations contain.
- $gatheringId : int
-
Gathering ID to validate.
- $futureOnly : bool = true
-
When true, only future gatherings are selectable.
Return values
boolbuildAttendanceMap()
private
buildAttendanceMap(array<string|int, int> $memberIds, bool $bulkMode) : array<int, bool|int>
Parameters
- $memberIds : array<string|int, int>
-
Member IDs.
- $bulkMode : bool
-
Use attendance counts when true.
Return values
array<int, bool|int> —gathering_id => bool (single) or count (bulk)
buildGatheringOptions()
private
buildGatheringOptions(array<string|int, int> $awardIds, array<string|int, int> $memberIds, bool $futureOnly, array<string|int, int> $includeGatheringIds, bool $bulkMode[, array<string|int, int> $recommendationIds = [] ]) : array{gatherings: array, cancelledGatheringIds: array, rankedGatherings: array>}
Parameters
- $awardIds : array<string|int, int>
-
Award IDs linked through bestowal recommendations.
- $memberIds : array<string|int, int>
-
Member IDs for attendance markers.
- $futureOnly : bool
-
Limit to future gatherings when true.
- $includeGatheringIds : array<string|int, int>
-
Gatherings that must appear even if filtered out.
- $bulkMode : bool
-
When true, attendance counts use *(N) suffix for multiple members.
- $recommendationIds : array<string|int, int> = []
-
Recommendation IDs with suggested gatherings.
Return values
array{gatherings: arraybuildRankedGatheringItem()
private
buildRankedGatheringItem(Gathering $gathering, array<int, bool|int> $attendanceMap, array<int, int> $suggestedMap, bool $bulkMode) : array<string, mixed>
Parameters
- $gathering : Gathering
-
Gathering entity with branch contain.
- $attendanceMap : array<int, bool|int>
-
Attendance markers keyed by gathering ID.
- $suggestedMap : array<int, int>
-
Suggested event counts keyed by gathering ID.
- $bulkMode : bool
-
Use count badges when true.
Return values
array<string, mixed>buildSuggestedGatheringMap()
private
buildSuggestedGatheringMap(array<string|int, int> $recommendationIds, bool $bulkMode) : array<int, int>
Parameters
- $recommendationIds : array<string|int, int>
-
Recommendation IDs.
- $bulkMode : bool
-
Use counts when true.
Return values
array<int, int>collectAwardIdsFromBestowal()
private
collectAwardIdsFromBestowal(Bestowal $bestowal) : array<string|int, int>
Parameters
- $bestowal : Bestowal
-
Loaded bestowal.
Return values
array<string|int, int>collectRecommendationIdsFromBestowal()
private
collectRecommendationIdsFromBestowal(Bestowal $bestowal) : array<string|int, int>
Parameters
- $bestowal : Bestowal
-
Loaded bestowal.
Return values
array<string|int, int>fetchGatheringsQuery()
private
fetchGatheringsQuery(Table $gatheringsTable, array<string|int, int> $activityIds, bool $futureOnly[, array<string|int, int> $gatheringIds = [] ]) : SelectQuery
Parameters
- $gatheringsTable : Table
-
Gatherings table.
- $activityIds : array<string|int, int>
-
Gathering activity IDs to filter by.
- $futureOnly : bool
-
Limit to future gatherings when true.
- $gatheringIds : array<string|int, int> = []
-
Gathering IDs to filter by.
Return values
SelectQueryformatGatheringLabel()
private
formatGatheringLabel(Gathering $gathering, array<int, bool|int> $attendanceMap, array<int, int> $suggestedMap, bool $bulkMode) : string
Parameters
- $gathering : Gathering
-
Gathering entity with branch contain.
- $attendanceMap : array<int, bool|int>
-
Attendance markers keyed by gathering ID.
- $suggestedMap : array<int, int>
-
Suggested event counts keyed by gathering ID.
- $bulkMode : bool
-
Use count suffix when true.
Return values
stringgroupRankedGatherings()
private
groupRankedGatherings(array<int, array<string, mixed>> $items) : array<int, array<string, mixed>>
Parameters
- $items : array<int, array<string, mixed>>
-
Ranked items by gathering ID.
Return values
array<int, array<string, mixed>>resolveCommonActivityIds()
private
resolveCommonActivityIds(array<string|int, int> $awardIds) : array<string|int, int>
Parameters
- $awardIds : array<string|int, int>
-
Award IDs.
Return values
array<string|int, int>resolveGatheringIdsSupportingAllAwards()
private
resolveGatheringIdsSupportingAllAwards(array<string|int, int> $awardIds) : array<string|int, int>
Parameters
- $awardIds : array<string|int, int>
-
Award IDs.