Oihana PHP

PrepareGroupBy

Prepares the `groupBy` parameter of a controller request.

This trait reads the ControllerParam::GROUP_BY value from the request (query or body, via getParam()). When a non-empty value is found it is assigned to the referenced $groupBy variable and mirrored into the parameter bag.

Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0

Table of Contents

Methods

prepareGroupBy()  : void
Prepares the `groupBy` parameter from the request.

Methods

prepareGroupBy()

Prepares the `groupBy` parameter from the request.

protected prepareGroupBy(ServerRequestInterface|null $request, array<string|int, mixed>|null &$params, string|null &$groupBy) : void
Parameters
$request : ServerRequestInterface|null

The incoming PSR-7 server request, or null when no request context is available.

$params : array<string|int, mixed>|null

A reference to the parameter bag updated in place with the resolved group-by value.

$groupBy : string|null

A reference to the group-by holder assigned in place when the request provides a value.

Tags
throws
NotFoundException

If the underlying parameter resolution fails to locate a required dependency.

On this page

Search results