PHP 클래스 Spatie\Fractal\Fractal

상속: implements JsonSerializabl\JsonSerializable
파일 보기 프로젝트 열기: spatie/laravel-fractal 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
normalizeIncludesOrExcludes ( array | string $includesOrExcludes = '' ) : array | string Normalize the includes an excludes.

메소드 상세

__call() 공개 메소드

Support for magic methods to included data.
public __call ( string $name, array $arguments )
$name string
$arguments array

__construct() 공개 메소드

public __construct ( League\Fractal\Manager $manager )
$manager League\Fractal\Manager

addMeta() 공개 메소드

Set the meta data.
public addMeta ( )

collection() 공개 메소드

Set the collection data that must be transformed.
public collection ( mixed $data, League\Fractal\TransformerAbstract | callable | null $transformer = null, string | null $resourceName = null )
$data mixed
$transformer League\Fractal\TransformerAbstract | callable | null
$resourceName string | null

createData() 공개 메소드

Create fractal data.
public createData ( ) : League\Fractal\Scope
리턴 League\Fractal\Scope

data() 공개 메소드

Set the data that must be transformed.
public data ( string $dataType, mixed $data, League\Fractal\TransformerAbstract | callable | null $transformer = null )
$dataType string
$data mixed
$transformer League\Fractal\TransformerAbstract | callable | null

getResource() 공개 메소드

Get the resource.
public getResource ( ) : League\Fractal\Resource\ResourceInterface
리턴 League\Fractal\Resource\ResourceInterface

item() 공개 메소드

Set the item data that must be transformed.
public item ( mixed $data, League\Fractal\TransformerAbstract | callable | null $transformer = null, string | null $resourceName = null )
$data mixed
$transformer League\Fractal\TransformerAbstract | callable | null
$resourceName string | null

jsonSerialize() 공개 메소드

Convert the object into something JSON serializable.
public jsonSerialize ( )

normalizeIncludesOrExcludes() 보호된 메소드

Normalize the includes an excludes.
protected normalizeIncludesOrExcludes ( array | string $includesOrExcludes = '' ) : array | string
$includesOrExcludes array | string
리턴 array | string

paginateWith() 공개 메소드

Set a Fractal paginator for the data.
public paginateWith ( League\Fractal\Pagination\PaginatorInterface $paginator )
$paginator League\Fractal\Pagination\PaginatorInterface

parseExcludes() 공개 메소드

Specify the excludes.
public parseExcludes ( array | string $excludes )
$excludes array | string Array or string of resources to exclude.

parseIncludes() 공개 메소드

Specify the includes.
public parseIncludes ( array | string $includes )
$includes array | string Array or string of resources to include.

serializeWith() 공개 메소드

Set the serializer to be used.
public serializeWith ( League\Fractal\Serializer\SerializerAbstract $serializer )
$serializer League\Fractal\Serializer\SerializerAbstract

toArray() 공개 메소드

Perform the transformation to array.
public toArray ( ) : array
리턴 array

toJson() 공개 메소드

Perform the transformation to json.
public toJson ( ) : string
리턴 string

transformWith() 공개 메소드

Set the class or function that will perform the transform.
public transformWith ( League\Fractal\TransformerAbstract | callable $transformer )
$transformer League\Fractal\TransformerAbstract | callable

withCursor() 공개 메소드

Set a Fractal cursor for the data.
public withCursor ( League\Fractal\Pagination\CursorInterface $cursor )
$cursor League\Fractal\Pagination\CursorInterface

withResourceName() 공개 메소드

Set the resource name, to replace 'data' as the root of the collection or item.
public withResourceName ( string $resourceName )
$resourceName string

프로퍼티 상세

$cursor 보호되어 있는 프로퍼티

protected CursorInterface,League\Fractal\Pagination $cursor
리턴 League\Fractal\Pagination\CursorInterface

$data 보호되어 있는 프로퍼티

protected mixed $data
리턴 mixed

$dataType 보호되어 있는 프로퍼티

protected string $dataType
리턴 string

$excludes 보호되어 있는 프로퍼티

protected array $excludes
리턴 array

$includes 보호되어 있는 프로퍼티

protected array $includes
리턴 array

$manager 보호되어 있는 프로퍼티

protected Manager,League\Fractal $manager
리턴 League\Fractal\Manager

$meta 보호되어 있는 프로퍼티

protected array $meta
리턴 array

$paginator 보호되어 있는 프로퍼티

protected PaginatorInterface,League\Fractal\Pagination $paginator
리턴 League\Fractal\Pagination\PaginatorInterface

$resourceName 보호되어 있는 프로퍼티

protected string $resourceName
리턴 string

$serializer 보호되어 있는 프로퍼티

protected SerializerAbstract,League\Fractal\Serializer $serializer
리턴 League\Fractal\Serializer\SerializerAbstract

$transformer 보호되어 있는 프로퍼티

protected TransformerAbstract,League\Fractal|callable $transformer
리턴 League\Fractal\TransformerAbstract | callable