PHP 인터페이스 Neomerx\JsonApi\Contracts\Http\ResponsesInterface

파일 보기 프로젝트 열기: neomerx/json-api 0 사용 예제들

공개 메소드들

메소드 설명
getCodeResponse ( integer $statusCode, array $headers = [] ) : mixed Get response with HTTP code only.
getContentResponse ( object | array $data, integer $statusCode = self::HTTP_OK, array | null $links = null, mixed $meta = null, array $headers = [] ) : mixed Get response with regular JSON API Document in body.
getCreatedResponse ( object $resource, array | null $links = null, mixed $meta = null, array $headers = [] ) : mixed Get response for newly created resource with HTTP code 201 (adds 'location' header).
getErrorResponse ( Neomerx\JsonApi\Contracts\Document\ErrorInterface | Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | ErrorCollection $errors, integer $statusCode = self::HTTP_BAD_REQUEST, array $headers = [] ) : mixed Get response with JSON API Error in body.
getIdentifiersResponse ( object | array $data, integer $statusCode = self::HTTP_OK, array | null $links = null, mixed $meta = null, array $headers = [] ) : mixed Get response with only resource identifiers.
getMetaResponse ( array | object $meta, integer $statusCode = self::HTTP_OK, array $headers = [] ) : mixed Get response with meta information only.

메소드 상세

getCodeResponse() 공개 메소드

Get response with HTTP code only.
public getCodeResponse ( integer $statusCode, array $headers = [] ) : mixed
$statusCode integer
$headers array
리턴 mixed

getContentResponse() 공개 메소드

Get response with regular JSON API Document in body.
public getContentResponse ( object | array $data, integer $statusCode = self::HTTP_OK, array | null $links = null, mixed $meta = null, array $headers = [] ) : mixed
$data object | array
$statusCode integer
$links array | null
$meta mixed
$headers array
리턴 mixed

getCreatedResponse() 공개 메소드

Get response for newly created resource with HTTP code 201 (adds 'location' header).
public getCreatedResponse ( object $resource, array | null $links = null, mixed $meta = null, array $headers = [] ) : mixed
$resource object
$links array | null
$meta mixed
$headers array
리턴 mixed

getErrorResponse() 공개 메소드

Get response with JSON API Error in body.
public getErrorResponse ( Neomerx\JsonApi\Contracts\Document\ErrorInterface | Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | ErrorCollection $errors, integer $statusCode = self::HTTP_BAD_REQUEST, array $headers = [] ) : mixed
$errors Neomerx\JsonApi\Contracts\Document\ErrorInterface | Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | Neomerx\JsonApi\Exceptions\ErrorCollection
$statusCode integer
$headers array
리턴 mixed

getIdentifiersResponse() 공개 메소드

Get response with only resource identifiers.
public getIdentifiersResponse ( object | array $data, integer $statusCode = self::HTTP_OK, array | null $links = null, mixed $meta = null, array $headers = [] ) : mixed
$data object | array
$statusCode integer
$links array | null
$meta mixed
$headers array
리턴 mixed

getMetaResponse() 공개 메소드

Get response with meta information only.
public getMetaResponse ( array | object $meta, integer $statusCode = self::HTTP_OK, array $headers = [] ) : mixed
$meta array | object Meta information.
$statusCode integer
$headers array
리턴 mixed