Oihana PHP System

PrepareFacets uses trait:short

Table of Contents

Properties

$params  : array<string|int, mixed>|null
The model reference.

Methods

initializeParams()  : static
Initialize the params definition.
prepareFacets()  : array<string|int, mixed>|null
Prepare the facets definitions.
prepareParamsFacets()  : void
Try to creates the facets definition with the $this->params array definition of the controller.

Properties

$params

The model reference.

public array<string|int, mixed>|null $params = null

Methods

initializeParams()

Initialize the params definition.

protected initializeParams([array<string|int, mixed> $init = [] ]) : static
Parameters
$init : array<string|int, mixed> = []
Return values
static

prepareFacets()

Prepare the facets definitions.

protected prepareFacets(ServerRequestInterface|null $request[, array<string|int, mixed> $args = [] ][, array<string|int, mixed>|null &$params = [] ]) : array<string|int, mixed>|null
Parameters
$request : ServerRequestInterface|null
$args : array<string|int, mixed> = []
$params : array<string|int, mixed>|null = []
Return values
array<string|int, mixed>|null

prepareParamsFacets()

Try to creates the facets definition with the $this->params array definition of the controller.

protected prepareParamsFacets(ServerRequestInterface|null $request[, array<string|int, mixed> $args = [] ][, array<string|int, mixed> &$facets = [] ][, array<string|int, mixed>|null &$params = [] ]) : void

Target all 'facets' definitions.

Parameters
$request : ServerRequestInterface|null
$args : array<string|int, mixed> = []
$facets : array<string|int, mixed> = []
$params : array<string|int, mixed>|null = []
Tags
example

To list with the controller multiple things by ids, you can invoke the route url : https://myapi/products?id=[12,255,300]

1 - Initialize the facets in the model definition :

FACETS =>
[
    Prop::ID =>
    [
         Facet::TYPE       => Facet::IN ,
         Facet::EXPRESSION => [ SQL::COLUMN => $primaryKey , SQL::TABLE => $tableAlias , SQL::ALTER => StringFunction::RTRIM   ] ,
    ] ,
]

2 - Defines the paramters behavior in the controller definition :

ControllerParam::PARAMS => [ Prop::ID => ControllerParam::FACETS ]

        
On this page

Search results