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>Eager loads the required relationships.</p>
<p>Set the serializer that will serialize data for the endpoint.</p>
No description
Details
at
line 98
ResponseInterface
handle(ServerRequestInterface $request)
<p>{@inheritdoc}</p>
at
line 139
abstract protected mixed
data(ServerRequestInterface $request, Document $document)
<p>Get the data to be serialized and assigned to the response document.</p>
at
line 148
abstract protected ElementInterface
createElement(mixed $data, SerializerInterface $serializer)
<p>Create a PHP JSON-API Element for output in the document.</p>
at
line 153
protected array
getRelationsToLoad()
<p>Returns the relations to load added by extenders.</p>
at
line 173
protected void
loadRelations(Collection $models, array $relations)
<p>Eager loads the required relationships.</p>
at
line 206
protected array
extractInclude(ServerRequestInterface $request)
at
line 217
protected array
extractFields(ServerRequestInterface $request)
at
line 227
protected array|null
extractSort(ServerRequestInterface $request)
at
line 237
protected int
extractOffset(ServerRequestInterface $request)
at
line 246
protected int
extractLimit(ServerRequestInterface $request)
at
line 255
protected array
extractFilter(ServerRequestInterface $request)
at
line 264
protected Parameters
buildParameters(ServerRequestInterface $request)
at
line 269
protected bool
sortIsDefault(ServerRequestInterface $request)
at
line 279
setSerializer(string $serializer)
<p>Set the serializer that will serialize data for the endpoint.</p>
at
line 289
addInclude(string|array $name)
<p>Include the given relationship by default.</p>
at
line 299
removeInclude(string|array $name)
<p>Don't include the given relationship by default.</p>
at
line 309
addOptionalInclude(string|array $name)
<p>Make the given relationship available for inclusion.</p>
at
line 319
removeOptionalInclude(string|array $name)
<p>Don't allow the given relationship to be included.</p>
at
line 329
setLimit(int $limit)
<p>Set the default number of results.</p>
at
line 339
setMaxLimit(int $max)
<p>Set the maximum number of results.</p>
at
line 349
addSortField(string|array $field)
<p>Allow sorting results by the given field.</p>
at
line 359
removeSortField(string|array $field)
<p>Disallow sorting results by the given field.</p>
at
line 369
setSort(array $sort)
<p>Set the default sort order for the results.</p>