Property | Type | Description | |
---|---|---|---|
$eagerLoading | boolean | Indicates if eager loading is enabled. | |
$fractal | League\Fractal\Manager | Fractal manager instance. | |
$includeKey | string | The include query string key. | |
$includeSeparator | string | The include separator. |
Method | Description | |
---|---|---|
__construct ( League\Fractal\Manager $fractal, string $includeKey = 'include', string $includeSeparator = ',', boolean $eagerLoading = true ) : void | Create a new fractal transformer instance. | |
disableEagerLoading ( ) : |
Disable eager loading. | |
enableEagerLoading ( ) : |
Enable eager loading. | |
getFractal ( ) : League\Fractal\Manager | Get the underlying Fractal instance. | |
parseFractalIncludes ( Dingo\Api\Http\Request $request ) : void | Parse the includes. | |
transform ( mixed $response, object $transformer, Dingo\Api\Transformer\Binding $binding, Dingo\Api\Http\Request $request ) : array | Transform a response with a transformer. |
Method | Description | |
---|---|---|
createPaginatorAdapter ( Illuminate\Contracts\Pagination\Paginator $paginator ) : League\Fractal\Pagination\IlluminatePaginatorAdapter | Create the Fractal paginator adapter. | |
createResource ( mixed $response, League\Fractal\TransformerAbstract $transformer, array $parameters ) : League\Fractal\Resource\Item | League\Fractal\Resource\Collection | Create a Fractal resource instance. | |
mergeEagerLoads ( League\Fractal\TransformerAbstract $transformer, string | array $requestedIncludes ) : array | Get includes as their array keys for eager loading. | |
shouldEagerLoad ( mixed $response ) : boolean | Eager loading is only performed when the response is or contains an Eloquent collection and eager loading is enabled. |
protected createPaginatorAdapter ( Illuminate\Contracts\Pagination\Paginator $paginator ) : League\Fractal\Pagination\IlluminatePaginatorAdapter | ||
$paginator | Illuminate\Contracts\Pagination\Paginator | |
return | League\Fractal\Pagination\IlluminatePaginatorAdapter |
protected createResource ( mixed $response, League\Fractal\TransformerAbstract $transformer, array $parameters ) : League\Fractal\Resource\Item | League\Fractal\Resource\Collection | ||
$response | mixed | |
$transformer | League\Fractal\TransformerAbstract | |
$parameters | array | |
return | League\Fractal\Resource\Item | League\Fractal\Resource\Collection |
public disableEagerLoading ( ) : |
||
return |
public enableEagerLoading ( ) : |
||
return |
public getFractal ( ) : League\Fractal\Manager | ||
return | League\Fractal\Manager |
public parseFractalIncludes ( Dingo\Api\Http\Request $request ) : void | ||
$request | Dingo\Api\Http\Request | |
return | void |
protected shouldEagerLoad ( mixed $response ) : boolean | ||
$response | mixed | |
return | boolean |
protected bool $eagerLoading | ||
return | boolean |
protected Manager,League\Fractal $fractal | ||
return | League\Fractal\Manager |
protected string $includeKey | ||
return | string |
protected string $includeSeparator | ||
return | string |