PHP Class Flarum\Api\Controller\AbstractSerializeController

Inheritance: implements Flarum\Http\Controller\ControllerInterface
Show file Open project: flarum/core Class Usage Examples

Public Properties

Property Type Description
$include array The relationships that are included by default.
$limit integer The number of records included by default.
$maxLimit integer The maximum number of records that can be requested.
$optionalInclude array The relationships that are available to be included.
$serializer string The name of the serializer class to output results with.
$sort array | null The default sort field and order to user.
$sortFields array The fields that are available to be sorted by.

Protected Properties

Property Type Description
$container Illuminate\Contracts\Container\Container
$events Illuminate\Contracts\Events\Dispatcher

Public Methods

Method Description
getContainer ( ) : Illuminate\Contracts\Container\Container
getEventDispatcher ( ) : Illuminate\Contracts\Events\Dispatcher
handle ( Psr\Http\Message\ServerRequestInterface $request )
setContainer ( Illuminate\Contracts\Container\Container $container )
setEventDispatcher ( Illuminate\Contracts\Events\Dispatcher $events )

Protected Methods

Method Description
buildParameters ( Psr\Http\Message\ServerRequestInterface $request ) : Parameters
createElement ( mixed $data, Tobscure\JsonApi\SerializerInterface $serializer ) : Tobscure\JsonApi\ElementInterface Create a PHP JSON-API Element for output in the document.
data ( Psr\Http\Message\ServerRequestInterface $request, Document $document ) : mixed Get the data to be serialized and assigned to the response document.
extractFields ( Psr\Http\Message\ServerRequestInterface $request ) : array
extractFilter ( Psr\Http\Message\ServerRequestInterface $request ) : array
extractInclude ( Psr\Http\Message\ServerRequestInterface $request ) : array
extractLimit ( Psr\Http\Message\ServerRequestInterface $request ) : integer
extractOffset ( Psr\Http\Message\ServerRequestInterface $request ) : integer
extractSort ( Psr\Http\Message\ServerRequestInterface $request ) : array | null

Method Details

buildParameters() protected method

protected buildParameters ( Psr\Http\Message\ServerRequestInterface $request ) : Parameters
$request Psr\Http\Message\ServerRequestInterface
return Tobscure\JsonApi\Parameters

createElement() abstract protected method

Create a PHP JSON-API Element for output in the document.
abstract protected createElement ( mixed $data, Tobscure\JsonApi\SerializerInterface $serializer ) : Tobscure\JsonApi\ElementInterface
$data mixed
$serializer Tobscure\JsonApi\SerializerInterface
return Tobscure\JsonApi\ElementInterface

data() abstract protected method

Get the data to be serialized and assigned to the response document.
abstract protected data ( Psr\Http\Message\ServerRequestInterface $request, Document $document ) : mixed
$request Psr\Http\Message\ServerRequestInterface
$document Tobscure\JsonApi\Document
return mixed

extractFields() protected method

protected extractFields ( Psr\Http\Message\ServerRequestInterface $request ) : array
$request Psr\Http\Message\ServerRequestInterface
return array

extractFilter() protected method

protected extractFilter ( Psr\Http\Message\ServerRequestInterface $request ) : array
$request Psr\Http\Message\ServerRequestInterface
return array

extractInclude() protected method

protected extractInclude ( Psr\Http\Message\ServerRequestInterface $request ) : array
$request Psr\Http\Message\ServerRequestInterface
return array

extractLimit() protected method

protected extractLimit ( Psr\Http\Message\ServerRequestInterface $request ) : integer
$request Psr\Http\Message\ServerRequestInterface
return integer

extractOffset() protected method

protected extractOffset ( Psr\Http\Message\ServerRequestInterface $request ) : integer
$request Psr\Http\Message\ServerRequestInterface
return integer

extractSort() protected method

protected extractSort ( Psr\Http\Message\ServerRequestInterface $request ) : array | null
$request Psr\Http\Message\ServerRequestInterface
return array | null

getContainer() public static method

public static getContainer ( ) : Illuminate\Contracts\Container\Container
return Illuminate\Contracts\Container\Container

getEventDispatcher() public static method

public static getEventDispatcher ( ) : Illuminate\Contracts\Events\Dispatcher
return Illuminate\Contracts\Events\Dispatcher

handle() public method

public handle ( Psr\Http\Message\ServerRequestInterface $request )
$request Psr\Http\Message\ServerRequestInterface

setContainer() public static method

public static setContainer ( Illuminate\Contracts\Container\Container $container )
$container Illuminate\Contracts\Container\Container

setEventDispatcher() public static method

public static setEventDispatcher ( Illuminate\Contracts\Events\Dispatcher $events )
$events Illuminate\Contracts\Events\Dispatcher

Property Details

$container protected static property

protected static Container,Illuminate\Contracts\Container $container
return Illuminate\Contracts\Container\Container

$events protected static property

protected static Dispatcher,Illuminate\Contracts\Events $events
return Illuminate\Contracts\Events\Dispatcher

$include public property

The relationships that are included by default.
public array $include
return array

$limit public property

The number of records included by default.
public int $limit
return integer

$maxLimit public property

The maximum number of records that can be requested.
public int $maxLimit
return integer

$optionalInclude public property

The relationships that are available to be included.
public array $optionalInclude
return array

$serializer public property

The name of the serializer class to output results with.
public string $serializer
return string

$sort public property

The default sort field and order to user.
public array|null $sort
return array | null

$sortFields public property

The fields that are available to be sorted by.
public array $sortFields
return array