class CreateDiscussionController extends AbstractCreateController

Properties

$serializer {@inheritdoc}
$include {@inheritdoc}
array $optionalInclude The relationships that are available to be included. from AbstractSerializeController
int $maxLimit The maximum number of records that can be requested. from AbstractSerializeController
int $limit The number of records included by default. from AbstractSerializeController
array $sortFields The fields that are available to be sorted by. from AbstractSerializeController
array|null $sort The default sort field and order to user. from AbstractSerializeController
static protected Container $container from AbstractSerializeController
static protected array $beforeDataCallbacks from AbstractSerializeController
static protected array $beforeSerializationCallbacks from AbstractSerializeController
static protected array $loadRelations from AbstractSerializeController
protected Dispatcher $bus

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.

void
loadRelations(Collection $models, array $relations)

Eager loads the required relationships.

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

static 
setLoadRelations(string $controllerClass, array $relations)

No description

__construct(Dispatcher $bus)

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 void loadRelations(Collection $models, array $relations)

Eager loads the required relationships.

Parameters

Collection $models
array $relations

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

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

static setLoadRelations(string $controllerClass, array $relations)

Parameters

string $controllerClass
array $relations

__construct(Dispatcher $bus)

Parameters

Dispatcher $bus