Property | Type | Description | |
---|---|---|---|
$cursor | League\Fractal\Pagination\CursorInterface | ||
$data | mixed | ||
$dataType | string | ||
$excludes | array | ||
$includes | array | ||
$manager | League\Fractal\Manager | ||
$meta | array | ||
$paginator | League\Fractal\Pagination\PaginatorInterface | ||
$resourceName | string | ||
$serializer | League\Fractal\Serializer\SerializerAbstract | ||
$transformer | League\Fractal\TransformerAbstract | callable |
Method | Description | |
---|---|---|
__call ( string $name, array $arguments ) | Support for magic methods to included data. | |
__construct ( League\Fractal\Manager $manager ) | ||
addMeta ( ) | Set the meta data. | |
collection ( mixed $data, League\Fractal\TransformerAbstract | callable | null $transformer = null, string | null $resourceName = null ) | Set the collection data that must be transformed. | |
createData ( ) : League\Fractal\Scope | Create fractal data. | |
data ( string $dataType, mixed $data, League\Fractal\TransformerAbstract | callable | null $transformer = null ) | Set the data that must be transformed. | |
getResource ( ) : League\Fractal\Resource\ResourceInterface | Get the resource. | |
item ( mixed $data, League\Fractal\TransformerAbstract | callable | null $transformer = null, string | null $resourceName = null ) | Set the item data that must be transformed. | |
jsonSerialize ( ) | Convert the object into something JSON serializable. | |
paginateWith ( League\Fractal\Pagination\PaginatorInterface $paginator ) | Set a Fractal paginator for the data. | |
parseExcludes ( array | string $excludes ) | Specify the excludes. | |
parseIncludes ( array | string $includes ) | Specify the includes. | |
serializeWith ( League\Fractal\Serializer\SerializerAbstract $serializer ) | Set the serializer to be used. | |
toArray ( ) : array | Perform the transformation to array. | |
toJson ( ) : string | Perform the transformation to json. | |
transformWith ( League\Fractal\TransformerAbstract | callable $transformer ) | Set the class or function that will perform the transform. | |
withCursor ( League\Fractal\Pagination\CursorInterface $cursor ) | Set a Fractal cursor for the data. | |
withResourceName ( string $resourceName ) | Set the resource name, to replace 'data' as the root of the collection or item. |
Method | Description | |
---|---|---|
normalizeIncludesOrExcludes ( array | string $includesOrExcludes = '' ) : array | string | Normalize the includes an excludes. |
public __construct ( League\Fractal\Manager $manager ) | ||
$manager | League\Fractal\Manager |
public createData ( ) : League\Fractal\Scope | ||
return | League\Fractal\Scope |
public getResource ( ) : League\Fractal\Resource\ResourceInterface | ||
return | League\Fractal\Resource\ResourceInterface |
public jsonSerialize ( ) |
public paginateWith ( League\Fractal\Pagination\PaginatorInterface $paginator ) | ||
$paginator | League\Fractal\Pagination\PaginatorInterface |
public parseExcludes ( array | string $excludes ) | ||
$excludes | array | string | Array or string of resources to exclude. |
public parseIncludes ( array | string $includes ) | ||
$includes | array | string | Array or string of resources to include. |
public serializeWith ( League\Fractal\Serializer\SerializerAbstract $serializer ) | ||
$serializer | League\Fractal\Serializer\SerializerAbstract |
public transformWith ( League\Fractal\TransformerAbstract | callable $transformer ) | ||
$transformer | League\Fractal\TransformerAbstract | callable |
public withCursor ( League\Fractal\Pagination\CursorInterface $cursor ) | ||
$cursor | League\Fractal\Pagination\CursorInterface |
public withResourceName ( string $resourceName ) | ||
$resourceName | string |
protected CursorInterface,League\Fractal\Pagination $cursor | ||
return | League\Fractal\Pagination\CursorInterface |
protected Manager,League\Fractal $manager | ||
return | League\Fractal\Manager |
protected PaginatorInterface,League\Fractal\Pagination $paginator | ||
return | League\Fractal\Pagination\PaginatorInterface |
protected SerializerAbstract,League\Fractal\Serializer $serializer | ||
return | League\Fractal\Serializer\SerializerAbstract |
protected TransformerAbstract,League\Fractal|callable $transformer | ||
return | League\Fractal\TransformerAbstract | callable |