class ListDiscussionsController extends AbstractListController

Properties

$serializer {@inheritdoc}
$include {@inheritdoc}
$optionalInclude {@inheritdoc}
int $maxLimit The maximum number of records that can be requested. from AbstractSerializeController
int $limit The number of records included by default. from AbstractSerializeController
$sortFields {@inheritdoc}
$sort {@inheritDoc}
static protected Container $container from AbstractSerializeController
static protected array $beforeDataCallbacks from AbstractSerializeController
static protected array $beforeSerializationCallbacks from AbstractSerializeController
protected DiscussionFilterer $filterer
protected DiscussionSearcher $searcher
protected UrlGenerator $url

Methods

ResponseInterface
handle(ServerRequestInterface $request)

{@inheritdoc}

mixed
data(ServerRequestInterface $request, Document $document)

Get the data to be serialized and assigned to the response document.

ElementInterface
createElement(mixed $data, SerializerInterface $serializer)

Create a PHP JSON-API Element for output in the document.

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

setSerializer(string $serializer)

Set the serializer that will serialize data for the endpoint.

addInclude(string|array $name)

Include the given relationship by default.

removeInclude(string|array $name)

Don't include the given relationship by default.

addOptionalInclude(string|array $name)

Make the given relationship available for inclusion.

removeOptionalInclude(string|array $name)

Don't allow the given relationship to be included.

setLimit(int $limit)

Set the default number of results.

setMaxLimit(int $max)

Set the maximum number of results.

addSortField(string|array $field)

Allow sorting results by the given field.

removeSortField(string|array $field)

Disallow sorting results by the given field.

setSort(array $sort)

Set the default sort order for the results.

static Container
getContainer()

No description

static 
setContainer(Container $container)

No description

static 
addDataPreparationCallback(string $controllerClass, callable $callback)

No description

static 
addSerializationPreparationCallback(string $controllerClass, callable $callback)

No description

__construct(DiscussionFilterer $filterer, DiscussionSearcher $searcher, UrlGenerator $url)

No description

Details

ResponseInterface handle(ServerRequestInterface $request)

{@inheritdoc}

Parameters

ServerRequestInterface $request

Return Value

ResponseInterface

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

Get the data to be serialized and assigned to the response document.

Parameters

ServerRequestInterface $request
Document $document

Return Value

mixed

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

Create a PHP JSON-API Element for output in the document.

Parameters

mixed $data
SerializerInterface $serializer

Return Value

ElementInterface

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

protected array extractFilter(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

array

protected Parameters buildParameters(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

Parameters

setSerializer(string $serializer)

Set the serializer that will serialize data for the endpoint.

Parameters

string $serializer

addInclude(string|array $name)

Include the given relationship by default.

Parameters

string|array $name

removeInclude(string|array $name)

Don't include the given relationship by default.

Parameters

string|array $name

addOptionalInclude(string|array $name)

Make the given relationship available for inclusion.

Parameters

string|array $name

removeOptionalInclude(string|array $name)

Don't allow the given relationship to be included.

Parameters

string|array $name

setLimit(int $limit)

Set the default number of results.

Parameters

int $limit

setMaxLimit(int $max)

Set the maximum number of results.

Parameters

int $max

addSortField(string|array $field)

Allow sorting results by the given field.

Parameters

string|array $field

removeSortField(string|array $field)

Disallow sorting results by the given field.

Parameters

string|array $field

setSort(array $sort)

Set the default sort order for the results.

Parameters

array $sort

static Container getContainer()

Return Value

Container

static setContainer(Container $container)

Parameters

Container $container

static addDataPreparationCallback(string $controllerClass, callable $callback)

Parameters

string $controllerClass
callable $callback

static addSerializationPreparationCallback(string $controllerClass, callable $callback)

Parameters

string $controllerClass
callable $callback

__construct(DiscussionFilterer $filterer, DiscussionSearcher $searcher, UrlGenerator $url)

Parameters

DiscussionFilterer $filterer
DiscussionSearcher $searcher
UrlGenerator $url