abstract class AbstractSerializeController implements RequestHandlerInterface
Properties
| string | $serializer | The name of the serializer class to output results with. |
|
|
| array | $include | The relationships that are included by default. |
|
|
| array | $optionalInclude | The relationships that are available to be included. |
|
|
| int | $maxLimit | The maximum number of records that can be requested. |
|
|
| int | $limit | The number of records included by default. |
|
|
| array | $sortFields | The fields that are available to be sorted by. |
|
|
| array|null | $sort | The default sort field and order to user. |
|
|
| static protected Container | $container |
|
||
| static protected array | $beforeDataCallbacks |
|
||
| static protected array | $beforeSerializationCallbacks |
|
||
| static protected string[] | $loadRelations |
|
||
| static protected array<string, callable> | $loadRelationCallables |
|
Methods
Get the data to be serialized and assigned to the response document.
Create a PHP JSON-API Element for output in the document.
Returns the relation callables to load added by extenders.
Eager loads the required relationships.
No description
Details
at
line 103
ResponseInterface
handle( ServerRequestInterface $request)
{@inheritdoc}
at
line 144
abstract protected mixed
data( ServerRequestInterface $request, Document $document)
Get the data to be serialized and assigned to the response document.
at
line 153
abstract protected ElementInterface
createElement(mixed $data, SerializerInterface $serializer)
Create a PHP JSON-API Element for output in the document.
at
line 160
protected array
getRelationsToLoad( Collection $models)
Returns the relations to load added by extenders.
at
line 178
protected array
getRelationCallablesToLoad( Collection $models)
Returns the relation callables to load added by extenders.
at
line 194
protected void
loadRelations( Collection $models, array $relations, ServerRequestInterface $request = null)
Eager loads the required relationships.
at
line 254
protected array
extractInclude( ServerRequestInterface $request)
at
line 265
protected array
extractFields( ServerRequestInterface $request)
at
line 275
protected array|null
extractSort( ServerRequestInterface $request)
at
line 285
protected int
extractOffset( ServerRequestInterface $request)
at
line 294
protected int
extractLimit( ServerRequestInterface $request)
at
line 303
protected array
extractFilter( ServerRequestInterface $request)
at
line 312
protected Parameters
buildParameters( ServerRequestInterface $request)
at
line 317
protected bool
sortIsDefault( ServerRequestInterface $request)
at
line 327
setSerializer(string $serializer)
Set the serializer that will serialize data for the endpoint.
at
line 337
addInclude(string|array $name)
Include the given relationship by default.
at
line 347
removeInclude(string|array $name)
Don't include the given relationship by default.
at
line 357
addOptionalInclude(string|array $name)
Make the given relationship available for inclusion.
at
line 367
removeOptionalInclude(string|array $name)
Don't allow the given relationship to be included.
at
line 377
setLimit(int $limit)
Set the default number of results.
at
line 387
setMaxLimit(int $max)
Set the maximum number of results.
at
line 397
addSortField(string|array $field)
Allow sorting results by the given field.
at
line 407
removeSortField(string|array $field)
Disallow sorting results by the given field.
at
line 417
setSort(array $sort)
Set the default sort order for the results.