class ShowGroupController extends AbstractShowController

Properties

$serializer
string[] $include <p>The relationships that are included by default.</p> from AbstractSerializeController
string[] $optionalInclude <p>The relationships that are available to be included.</p> from AbstractSerializeController
$maxLimit <p>The maximum number of records that can be requested.</p> from AbstractSerializeController
$limit <p>The number of records included by default.</p> from AbstractSerializeController
string[] $sortFields <p>The fields that are available to be sorted by.</p> from AbstractSerializeController
array<string,string>|null $sort <p>The default sort field and order to use.</p> from AbstractSerializeController
static protected $container from AbstractSerializeController
static protected $beforeDataCallbacks from AbstractSerializeController
static protected $beforeSerializationCallbacks from AbstractSerializeController
static protected string[][] $loadRelations from AbstractSerializeController
static protected array<string,callable> $loadRelationCallables from AbstractSerializeController

Methods

ResponseInterface
handle(ServerRequestInterface $request)

No description

mixed
data(ServerRequestInterface $request, Document $document)

<p>Get the data to be serialized and assigned to the response document.</p>

ElementInterface
createElement(mixed $data, SerializerInterface $serializer)

<p>Create a PHP JSON-API Element for output in the document.</p>

array
getRelationsToLoad(Collection $models)

<p>Returns the relations to load added by extenders.</p>

array
getRelationCallablesToLoad(Collection $models)

<p>Returns the relation callables to load added by extenders.</p>

void
loadRelations(Collection $models, array $relations, ServerRequestInterface $request = null)

<p>Eager loads the required relationships.</p>

array
extractInclude(ServerRequestInterface $request)

No description

array
extractFields(ServerRequestInterface $request)

No description

array|null
extractSort(ServerRequestInterface $request)

No description

int
extractOffset(ServerRequestInterface $request)

No description

int
extractLimit(ServerRequestInterface $request)

No description

array
extractFilter(ServerRequestInterface $request)

No description

Parameters
buildParameters(ServerRequestInterface $request)

No description

bool
sortIsDefault(ServerRequestInterface $request)

No description

void
setSerializer(string $serializer)

<p>Set the serializer that will serialize data for the endpoint.</p>

void
addInclude(array|string $name)

<p>Include the given relationship by default.</p>

void
removeInclude(array|string $name)

<p>Don't include the given relationship by default.</p>

void
addOptionalInclude(array|string $name)

<p>Make the given relationship available for inclusion.</p>

void
removeOptionalInclude(array|string $name)

<p>Don't allow the given relationship to be included.</p>

void
setLimit(int $limit)

<p>Set the default number of results.</p>

void
setMaxLimit(int $max)

<p>Set the maximum number of results.</p>

void
addSortField(array|string $field)

<p>Allow sorting results by the given field.</p>

void
removeSortField(array|string $field)

<p>Disallow sorting results by the given field.</p>

void
setSort(array $sort)

<p>Set the default sort order for the results.</p>

static Container
getContainer()

No description

static void
setContainer(Container $container)

No description

static void
addDataPreparationCallback(string $controllerClass, callable $callback)

No description

static void
addSerializationPreparationCallback(string $controllerClass, callable $callback)

No description

static void
setLoadRelations(string $controllerClass, array $relations)

No description

static void
setLoadRelationCallables(string $controllerClass, array $relations)

No description

__construct(GroupRepository $groups)

No description

Details

ResponseInterface handle(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

ResponseInterface

protected mixed data(ServerRequestInterface $request, Document $document)

<p>Get the data to be serialized and assigned to the response document.</p>

Parameters

ServerRequestInterface $request
Document $document

Return Value

mixed

protected ElementInterface createElement(mixed $data, SerializerInterface $serializer)

<p>Create a PHP JSON-API Element for output in the document.</p>

Parameters

mixed $data
SerializerInterface $serializer

Return Value

ElementInterface

protected array getRelationsToLoad(Collection $models)

<p>Returns the relations to load added by extenders.</p>

Parameters

Collection $models

Return Value

array

protected array getRelationCallablesToLoad(Collection $models)

<p>Returns the relation callables to load added by extenders.</p>

Parameters

Collection $models

Return Value

array

protected void loadRelations(Collection $models, array $relations, ServerRequestInterface $request = null)

<p>Eager loads the required relationships.</p>

Parameters

Collection $models
array $relations
ServerRequestInterface $request

Return Value

void

protected array extractInclude(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

array

Exceptions

InvalidParameterException

protected array extractFields(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

array

protected array|null extractSort(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

array|null

Exceptions

InvalidParameterException

protected int extractOffset(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

int

Exceptions

InvalidParameterException

protected int extractLimit(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

int

Exceptions

InvalidParameterException

protected array extractFilter(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

array

protected Parameters buildParameters(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

Parameters

protected bool sortIsDefault(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

bool

void setSerializer(string $serializer)

<p>Set the serializer that will serialize data for the endpoint.</p>

Parameters

string $serializer

Return Value

void

void addInclude(array|string $name)

<p>Include the given relationship by default.</p>

Parameters

array|string $name

Return Value

void

void removeInclude(array|string $name)

<p>Don't include the given relationship by default.</p>

Parameters

array|string $name

Return Value

void

void addOptionalInclude(array|string $name)

<p>Make the given relationship available for inclusion.</p>

Parameters

array|string $name

Return Value

void

void removeOptionalInclude(array|string $name)

<p>Don't allow the given relationship to be included.</p>

Parameters

array|string $name

Return Value

void

void setLimit(int $limit)

<p>Set the default number of results.</p>

Parameters

int $limit

Return Value

void

void setMaxLimit(int $max)

<p>Set the maximum number of results.</p>

Parameters

int $max

Return Value

void

void addSortField(array|string $field)

<p>Allow sorting results by the given field.</p>

Parameters

array|string $field

Return Value

void

void removeSortField(array|string $field)

<p>Disallow sorting results by the given field.</p>

Parameters

array|string $field

Return Value

void

void setSort(array $sort)

<p>Set the default sort order for the results.</p>

Parameters

array $sort

Return Value

void

static Container getContainer()

Return Value

Container

static void setContainer(Container $container)

Parameters

Container $container

Return Value

void

static void addDataPreparationCallback(string $controllerClass, callable $callback)

Parameters

string $controllerClass
callable $callback

Return Value

void

static void addSerializationPreparationCallback(string $controllerClass, callable $callback)

Parameters

string $controllerClass
callable $callback

Return Value

void

static void setLoadRelations(string $controllerClass, array $relations)

Parameters

string $controllerClass
array $relations

Return Value

void

static void setLoadRelationCallables(string $controllerClass, array $relations)

Parameters

string $controllerClass
array $relations

Return Value

void

__construct(GroupRepository $groups)

Parameters

GroupRepository $groups