PHP 클래스 Dingo\Api\Http\Response

상속: extends Illuminate\Http\Response
파일 보기 프로젝트 열기: dingo/api 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$exception Exception The exception that triggered the error response.

보호된 프로퍼티들

프로퍼티 타입 설명
$binding Dingo\Api\Transformer\Binding Transformer binding instance.
$events Illuminate\Events\Dispatcher Event dispatcher instance.
$formatters array Array of registered formatters.
$transformer Dingo\Api\Transformer\TransformerFactory Transformer factory instance.

공개 메소드들

메소드 설명
__construct ( mixed $content, integer $status = 200, array $headers = [], Dingo\Api\Transformer\Binding $binding = null ) : void Create a new response instance.
addFormatter ( string $key, Dingo\Api\Http\Response\Format\Format $formatter ) : void Add a response formatter.
addMeta ( string $key, mixed $value ) : Response Add a meta key and value pair.
cookie ( Cookie | mixed $cookie ) : Response Add a cookie to the response.
getFormatter ( string $format ) : Dingo\Api\Http\Response\Format\Format Get the formatter based on the requested format type.
getMeta ( ) : array Get the meta data for the response.
getTransformer ( ) : Dingo\Api\Transformer\Factory Get the transformer instance.
hasFormatter ( string $format ) : boolean Determine if a response formatter has been registered.
makeFromExisting ( Illuminate\Http\Response $old ) : Response Make an API response from an existing Illuminate response.
makeFromJson ( Illuminate\Http\JsonResponse $json ) : Response Make an API response from an existing JSON response.
meta ( string $key, mixed $value ) : Response Add a meta key and value pair.
morph ( string $format = 'json' ) : Response Morph the API response to the appropriate format.
setContent ( $content )
setEventDispatcher ( Illuminate\Events\Dispatcher $events ) : void Set the event dispatcher instance.
setFormatters ( array $formatters ) : void Set the response formatters.
setMeta ( array $meta ) : Response Set the meta data for the response.
setTransformer ( Dingo\Api\Transformer\Factory $transformer ) : void Set the transformer factory instance.
statusCode ( integer $statusCode ) : Response Set the response status code.
withHeader ( string $key, string $value, boolean $replace = true ) : Response Add a header to the response.

보호된 메소드들

메소드 설명
fireMorphedEvent ( ) : void Fire the morphed event.
fireMorphingEvent ( ) : void Fire the morphing event.

메소드 상세

__construct() 공개 메소드

Create a new response instance.
public __construct ( mixed $content, integer $status = 200, array $headers = [], Dingo\Api\Transformer\Binding $binding = null ) : void
$content mixed
$status integer
$headers array
$binding Dingo\Api\Transformer\Binding
리턴 void

addFormatter() 공개 정적인 메소드

Add a response formatter.
public static addFormatter ( string $key, Dingo\Api\Http\Response\Format\Format $formatter ) : void
$key string
$formatter Dingo\Api\Http\Response\Format\Format
리턴 void

addMeta() 공개 메소드

Add a meta key and value pair.
public addMeta ( string $key, mixed $value ) : Response
$key string
$value mixed
리턴 Response

fireMorphedEvent() 보호된 메소드

Fire the morphed event.
protected fireMorphedEvent ( ) : void
리턴 void

fireMorphingEvent() 보호된 메소드

Fire the morphing event.
protected fireMorphingEvent ( ) : void
리턴 void

getFormatter() 공개 정적인 메소드

Get the formatter based on the requested format type.
public static getFormatter ( string $format ) : Dingo\Api\Http\Response\Format\Format
$format string
리턴 Dingo\Api\Http\Response\Format\Format

getMeta() 공개 메소드

Get the meta data for the response.
public getMeta ( ) : array
리턴 array

getTransformer() 공개 정적인 메소드

Get the transformer instance.
public static getTransformer ( ) : Dingo\Api\Transformer\Factory
리턴 Dingo\Api\Transformer\Factory

hasFormatter() 공개 정적인 메소드

Determine if a response formatter has been registered.
public static hasFormatter ( string $format ) : boolean
$format string
리턴 boolean

makeFromExisting() 공개 정적인 메소드

Make an API response from an existing Illuminate response.
public static makeFromExisting ( Illuminate\Http\Response $old ) : Response
$old Illuminate\Http\Response
리턴 Response

makeFromJson() 공개 정적인 메소드

Make an API response from an existing JSON response.
public static makeFromJson ( Illuminate\Http\JsonResponse $json ) : Response
$json Illuminate\Http\JsonResponse
리턴 Response

meta() 공개 메소드

Add a meta key and value pair.
public meta ( string $key, mixed $value ) : Response
$key string
$value mixed
리턴 Response

morph() 공개 메소드

Morph the API response to the appropriate format.
public morph ( string $format = 'json' ) : Response
$format string
리턴 Response

setContent() 공개 메소드

public setContent ( $content )

setEventDispatcher() 공개 정적인 메소드

Set the event dispatcher instance.
public static setEventDispatcher ( Illuminate\Events\Dispatcher $events ) : void
$events Illuminate\Events\Dispatcher
리턴 void

setFormatters() 공개 정적인 메소드

Set the response formatters.
public static setFormatters ( array $formatters ) : void
$formatters array
리턴 void

setMeta() 공개 메소드

Set the meta data for the response.
public setMeta ( array $meta ) : Response
$meta array
리턴 Response

setTransformer() 공개 정적인 메소드

Set the transformer factory instance.
public static setTransformer ( Dingo\Api\Transformer\Factory $transformer ) : void
$transformer Dingo\Api\Transformer\Factory
리턴 void

statusCode() 공개 메소드

Set the response status code.
public statusCode ( integer $statusCode ) : Response
$statusCode integer
리턴 Response

withHeader() 공개 메소드

Add a header to the response.
public withHeader ( string $key, string $value, boolean $replace = true ) : Response
$key string
$value string
$replace boolean
리턴 Response

프로퍼티 상세

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

Transformer binding instance.
protected Binding,Dingo\Api\Transformer $binding
리턴 Dingo\Api\Transformer\Binding

$events 보호되어 있는 정적으로 프로퍼티

Event dispatcher instance.
protected static Dispatcher,Illuminate\Events $events
리턴 Illuminate\Events\Dispatcher

$exception 공개적으로 프로퍼티

The exception that triggered the error response.
public Exception $exception
리턴 Exception

$formatters 보호되어 있는 정적으로 프로퍼티

Array of registered formatters.
protected static array $formatters
리턴 array

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

Transformer factory instance.
protected static TransformerFactory,Dingo\Api\Transformer $transformer
리턴 Dingo\Api\Transformer\TransformerFactory