프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$manager | League\Fractal\Manager | The manager responsible for transforming and serializing data. | |
$meta | array | The meta data appended to the serialized data. | |
$relations | array | The included relations. | |
$resource | League\Fractal\Resource\ResourceInterface | The Fractal resource instance containing the data and transformer. | |
$resourceFactory | The resource factory used to generate resource instances. | ||
$statusCode | integer | The HTTP status code for the response. |
메소드 | 설명 | |
---|---|---|
__construct ( Illuminate\Contracts\Routing\ResponseFactory | |
SuccessResponseBuilder constructor. | |
addMeta ( array $data ) : |
Add data to the meta data appended to the response data. | |
getManager ( ) : League\Fractal\Manager | Get the Fractal manager responsible for transforming and serializing the data. | |
getResource ( ) : League\Fractal\Resource\ResourceInterface | Get the Fractal resource instance. | |
include ( array | string $relations ) : |
Set the serializer used to serialize the resource data. | |
serializer ( League\Fractal\Serializer\SerializerAbstract | string $serializer ) : |
Set the serializer used to serialize the resource data. | |
setStatus ( integer $statusCode ) : |
Set the HTTP status code for the response. | |
toArray ( ) : array | Convert the response to an array. | |
transform ( mixed | null $data = null, callable | string | null $transformer = null, string $resourceKey = null ) : |
Set the transformation data. This will set a new resource instance on the response builder depending on what type of data is provided. |
메소드 | 설명 | |
---|---|---|
parseTransformer ( |
Parse a transformer class and set relations. | |
resolveModel ( |
Resolve a model instance from the data. | |
resolveNestedRelations ( |
Resolve eager loaded relations from the model including any nested relations. | |
resolveRelations ( |
Resolve eager loaded relations from the model. | |
resolveResourceKey ( |
Resolve the resource key from the model. | |
resolveSerializer ( League\Fractal\Serializer\SerializerAbstract | string $serializer ) : League\Fractal\Serializer\SerializerAbstract | Resolve a serializer instance from the value. | |
resolveTransformer ( |
Resolve a transformer. | |
resolveTransformerFromModel ( |
Resolve a transformer from the model. If the model is not transformable, a closure based transformer will be created instead, from the model's fillable attributes. | |
serialize ( League\Fractal\Resource\ResourceInterface $resource ) : array | Serialize the transformation data. |
public __construct ( Illuminate\Contracts\Routing\ResponseFactory | |
||
$responseFactory | Illuminate\Contracts\Routing\ResponseFactory | |
|
$resourceFactory | ||
$manager | League\Fractal\Manager |
public getManager ( ) : League\Fractal\Manager | ||
리턴 | League\Fractal\Manager |
public getResource ( ) : League\Fractal\Resource\ResourceInterface | ||
리턴 | League\Fractal\Resource\ResourceInterface |
protected parseTransformer ( |
||
$transformer | ||
$model | ||
리턴 |
protected resolveModel ( |
||
$data | ||
리턴 |
protected resolveNestedRelations ( |
||
$data | ||
리턴 | array |
protected resolveRelations ( |
||
$model | ||
리턴 | array |
protected resolveResourceKey ( |
||
$model | ||
$resourceKey | string | |
리턴 | string |
protected resolveSerializer ( League\Fractal\Serializer\SerializerAbstract | string $serializer ) : League\Fractal\Serializer\SerializerAbstract | ||
$serializer | League\Fractal\Serializer\SerializerAbstract | string | |
리턴 | League\Fractal\Serializer\SerializerAbstract |
protected resolveTransformerFromModel ( |
||
$model | ||
리턴 |
public serializer ( League\Fractal\Serializer\SerializerAbstract | string $serializer ) : |
||
$serializer | League\Fractal\Serializer\SerializerAbstract | string | |
리턴 |
protected Manager,League\Fractal $manager | ||
리턴 | League\Fractal\Manager |
protected ResourceInterface,League\Fractal\Resource $resource | ||
리턴 | League\Fractal\Resource\ResourceInterface |
protected ResourceFactory,Flugg\Responder $resourceFactory | ||
리턴 |
protected int $statusCode | ||
리턴 | integer |