PHP Class Flugg\Responder\Serializers\ApiSerializer

Author: Alexander Tømmerås ([email protected])
Inheritance: extends League\Fractal\Serializer\ArraySerializer
Show file Open project: flugger/laravel-responder

Public Methods

Method Description
collection ( string $resourceKey, array $data ) : array Serialize a collection.
includedData ( League\Fractal\Resource\ResourceInterface $resource, array $data ) : array Serialize the included data.
item ( string $resourceKey, array $data ) : array Serialize an item.
mergeIncludes ( array $transformedData, array $includedData ) : array Merges any relations into the data. The 'data' field is also removed.
meta ( array $meta ) : array Serialize the meta.
null ( ) : array Serialize a null resource.
paginator ( League\Fractal\Pagination\PaginatorInterface $paginator ) : array Serialize the paginator.
sideloadIncludes ( ) : boolean Indicates if includes should be side-loaded.

Method Details

collection() public method

Serialize a collection.
public collection ( string $resourceKey, array $data ) : array
$resourceKey string
$data array
return array

includedData() public method

Serialize the included data.
public includedData ( League\Fractal\Resource\ResourceInterface $resource, array $data ) : array
$resource League\Fractal\Resource\ResourceInterface
$data array
return array

item() public method

Serialize an item.
public item ( string $resourceKey, array $data ) : array
$resourceKey string
$data array
return array

mergeIncludes() public method

Merges any relations into the data. The 'data' field is also removed.
public mergeIncludes ( array $transformedData, array $includedData ) : array
$transformedData array
$includedData array
return array

meta() public method

Serialize the meta.
public meta ( array $meta ) : array
$meta array
return array

null() public method

Serialize a null resource.
public null ( ) : array
return array

paginator() public method

Serialize the paginator.
public paginator ( League\Fractal\Pagination\PaginatorInterface $paginator ) : array
$paginator League\Fractal\Pagination\PaginatorInterface
return array

sideloadIncludes() public method

Indicates if includes should be side-loaded.
public sideloadIncludes ( ) : boolean
return boolean