RecommendationQueryService
in package
Builds configured ORM queries and grid-processing option arrays for recommendation grids.
Centralises the query-construction and option-building logic shared by the main grid, member-submitted, recs-for-member, and gathering-awards grid endpoints. The controller retains responsibility for authorization, view-variable assignment, and template rendering.
Tags
Table of Contents
Methods
- applyHiddenStateVisibility() : SelectQuery
- Apply hidden-state visibility constraints to a recommendations query.
- buildGatheringAwardsQuery() : SelectQuery, gridOptions: array}
- Build the base query and grid options for the gathering-awards grid.
- buildMainGridQuery() : SelectQuery, gridOptions: array}
- Build the base query and grid options for the main recommendations index.
- buildMemberSubmittedQuery() : SelectQuery, gridOptions: array}
- Build the base query and grid options for the member-submitted recommendations grid.
- buildRecsForMemberQuery() : SelectQuery, gridOptions: array}
- Build the base query and grid options for the recs-for-member grid.
Methods
applyHiddenStateVisibility()
Apply hidden-state visibility constraints to a recommendations query.
public
applyHiddenStateVisibility(SelectQuery $query, bool $canViewHidden) : SelectQuery
Parameters
- $query : SelectQuery
-
Recommendations query.
- $canViewHidden : bool
-
Whether hidden rows may be included.
Return values
SelectQuerybuildGatheringAwardsQuery()
Build the base query and grid options for the gathering-awards grid.
public
buildGatheringAwardsQuery(Table $recommendationsTable, int $gatheringId, bool $canEdit) : SelectQuery, gridOptions: array}
Parameters
- $recommendationsTable : Table
-
The Recommendations ORM table.
- $gatheringId : int
-
The gathering ID to filter by.
- $canEdit : bool
-
Whether the current user can edit recommendations (enables bulk actions).
Return values
SelectQuery, gridOptions: array} —Base query and processDataverseGrid options.
buildMainGridQuery()
Build the base query and grid options for the main recommendations index.
public
buildMainGridQuery(Table $recommendationsTable, bool $canEdit) : SelectQuery, gridOptions: array}
Parameters
- $recommendationsTable : Table
-
The Recommendations ORM table.
- $canEdit : bool
-
Whether the current user can edit recommendations (enables bulk actions).
Return values
SelectQuery, gridOptions: array} —Base query and processDataverseGrid options.
buildMemberSubmittedQuery()
Build the base query and grid options for the member-submitted recommendations grid.
public
buildMemberSubmittedQuery(Table $recommendationsTable, int $memberId) : SelectQuery, gridOptions: array}
Parameters
- $recommendationsTable : Table
-
The Recommendations ORM table.
- $memberId : int
-
The requester member ID to filter by.
Return values
SelectQuery, gridOptions: array} —Base query and processDataverseGrid options.
buildRecsForMemberQuery()
Build the base query and grid options for the recs-for-member grid.
public
buildRecsForMemberQuery(Table $recommendationsTable, int $memberId) : SelectQuery, gridOptions: array}
Parameters
- $recommendationsTable : Table
-
The Recommendations ORM table.
- $memberId : int
-
The subject member ID to filter by.
Return values
SelectQuery, gridOptions: array} —Base query and processDataverseGrid options.