abstract class AbstractSerializeController implements RequestHandlerInterface
Properties
Methods
<p>Get the data to be serialized and assigned to the response document.</p>
<p>Create a PHP JSON-API Element for output in the document.</p>
<p>Returns the relations to load added by extenders.</p>
<p>Returns the relation callables to load added by extenders.</p>
<p>Eager loads the required relationships.</p>
<p>Set the serializer that will serialize data for the endpoint.</p>
<p>Make the given relationship available for inclusion.</p>
<p>Don't allow the given relationship to be included.</p>
No description
Details
at
line 96
ResponseInterface
handle(ServerRequestInterface $request)
at
line 137
abstract protected mixed
data(ServerRequestInterface $request, Document $document)
<p>Get the data to be serialized and assigned to the response document.</p>
at
line 142
abstract protected ElementInterface
createElement(mixed $data, SerializerInterface $serializer)
<p>Create a PHP JSON-API Element for output in the document.</p>
at
line 149
protected array
getRelationsToLoad(Collection $models)
<p>Returns the relations to load added by extenders.</p>
at
line 167
protected array
getRelationCallablesToLoad(Collection $models)
<p>Returns the relation callables to load added by extenders.</p>
at
line 183
protected void
loadRelations(Collection $models, array $relations, ServerRequestInterface $request = null)
<p>Eager loads the required relationships.</p>
at
line 241
protected array
extractInclude(ServerRequestInterface $request)
at
line 248
protected array
extractFields(ServerRequestInterface $request)
at
line 256
protected array|null
extractSort(ServerRequestInterface $request)
at
line 264
protected int
extractOffset(ServerRequestInterface $request)
at
line 272
protected int
extractLimit(ServerRequestInterface $request)
at
line 277
protected array
extractFilter(ServerRequestInterface $request)
at
line 282
protected Parameters
buildParameters(ServerRequestInterface $request)
at
line 287
protected bool
sortIsDefault(ServerRequestInterface $request)
at
line 295
void
setSerializer(string $serializer)
<p>Set the serializer that will serialize data for the endpoint.</p>
at
line 303
void
addInclude(array|string $name)
<p>Include the given relationship by default.</p>
at
line 311
void
removeInclude(array|string $name)
<p>Don't include the given relationship by default.</p>
at
line 319
void
addOptionalInclude(array|string $name)
<p>Make the given relationship available for inclusion.</p>
at
line 327
void
removeOptionalInclude(array|string $name)
<p>Don't allow the given relationship to be included.</p>
at
line 335
void
setLimit(int $limit)
<p>Set the default number of results.</p>
at
line 343
void
setMaxLimit(int $max)
<p>Set the maximum number of results.</p>
at
line 351
void
addSortField(array|string $field)
<p>Allow sorting results by the given field.</p>
at
line 359
void
removeSortField(array|string $field)
<p>Disallow sorting results by the given field.</p>
at
line 367
void
setSort(array $sort)
<p>Set the default sort order for the results.</p>