abstract class AbstractSerializeController implements RequestHandlerInterface
Properties
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 104
ResponseInterface
handle(ServerRequestInterface $request)
{@inheritdoc}
at
line 149
abstract protected mixed
data(ServerRequestInterface $request, Document $document)
Get the data to be serialized and assigned to the response document.
at
line 158
abstract protected ElementInterface
createElement(mixed $data, SerializerInterface $serializer)
Create a PHP JSON-API Element for output in the document.
at
line 165
protected array
getRelationsToLoad(Collection $models)
Returns the relations to load added by extenders.
at
line 183
protected array
getRelationCallablesToLoad(Collection $models)
Returns the relation callables to load added by extenders.
at
line 199
protected void
loadRelations(Collection $models, array $relations, ServerRequestInterface $request = null)
Eager loads the required relationships.
at
line 259
protected array
extractInclude(ServerRequestInterface $request)
at
line 270
protected array
extractFields(ServerRequestInterface $request)
at
line 280
protected array|null
extractSort(ServerRequestInterface $request)
at
line 290
protected int
extractOffset(ServerRequestInterface $request)
at
line 299
protected int
extractLimit(ServerRequestInterface $request)
at
line 308
protected array
extractFilter(ServerRequestInterface $request)
at
line 317
protected Parameters
buildParameters(ServerRequestInterface $request)
at
line 322
protected bool
sortIsDefault(ServerRequestInterface $request)
at
line 332
setSerializer(string $serializer)
Set the serializer that will serialize data for the endpoint.
at
line 342
addInclude(string|array $name)
Include the given relationship by default.
at
line 352
removeInclude(string|array $name)
Don't include the given relationship by default.
at
line 362
addOptionalInclude(string|array $name)
Make the given relationship available for inclusion.
at
line 372
removeOptionalInclude(string|array $name)
Don't allow the given relationship to be included.
at
line 382
setLimit(int $limit)
Set the default number of results.
at
line 392
setMaxLimit(int $max)
Set the maximum number of results.
at
line 402
addSortField(string|array $field)
Allow sorting results by the given field.
at
line 412
removeSortField(string|array $field)
Disallow sorting results by the given field.
at
line 422
setSort(array $sort)
Set the default sort order for the results.