PHP Класс Dingo\Api\Http\Response\Factory

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$transformer Dingo\Api\Transformer\Factory Transformer factory instance.

Открытые методы

Метод Описание
__call ( string $method, array $parameters ) : mixed Call magic methods beginning with "with".
__construct ( Dingo\Api\Transformer\Factory $transformer ) : void Create a new response factory instance.
accepted ( null | string $location = null, mixed $content = null ) : Response Respond with an accepted response and associate a location and/or content if provided.
collection ( Collection $collection, object $transformer, array | Closure $parameters = [], Closure $after = null ) : Response Bind a collection to a transformer and start building a response.
created ( null | string $location = null, $content = null ) : Response Respond with a created response and associate a location if provided.
error ( string $message, integer $statusCode ) : void Return an error response.
errorBadRequest ( string $message = 'Bad Request' ) : void Return a 400 bad request error.
errorForbidden ( string $message = 'Forbidden' ) : void Return a 403 forbidden error.
errorInternal ( string $message = 'Internal Error' ) : void Return a 500 internal server error.
errorMethodNotAllowed ( string $message = 'Method Not Allowed' ) : void Return a 405 method not allowed error.
errorNotFound ( string $message = 'Not Found' ) : void Return a 404 not found error.
errorUnauthorized ( string $message = 'Unauthorized' ) : void Return a 401 unauthorized error.
item ( object $item, object $transformer, array $parameters = [], Closure $after = null ) : Response Bind an item to a transformer and start building a response.
noContent ( ) : Response Respond with a no content response.
paginator ( Illuminate\Contracts\Pagination\Paginator $paginator, object $transformer, array $parameters = [], Closure $after = null ) : Response Bind a paginator to a transformer and start building a response.

Описание методов

__call() публичный Метод

Call magic methods beginning with "with".
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

__construct() публичный Метод

Create a new response factory instance.
public __construct ( Dingo\Api\Transformer\Factory $transformer ) : void
$transformer Dingo\Api\Transformer\Factory
Результат void

accepted() публичный Метод

Respond with an accepted response and associate a location and/or content if provided.
public accepted ( null | string $location = null, mixed $content = null ) : Response
$location null | string
$content mixed
Результат Dingo\Api\Http\Response

collection() публичный Метод

Bind a collection to a transformer and start building a response.
public collection ( Collection $collection, object $transformer, array | Closure $parameters = [], Closure $after = null ) : Response
$collection Illuminate\Support\Collection
$transformer object
$parameters array | Closure
$after Closure
Результат Dingo\Api\Http\Response

created() публичный Метод

Respond with a created response and associate a location if provided.
public created ( null | string $location = null, $content = null ) : Response
$location null | string
Результат Dingo\Api\Http\Response

error() публичный Метод

Return an error response.
public error ( string $message, integer $statusCode ) : void
$message string
$statusCode integer
Результат void

errorBadRequest() публичный Метод

Return a 400 bad request error.
public errorBadRequest ( string $message = 'Bad Request' ) : void
$message string
Результат void

errorForbidden() публичный Метод

Return a 403 forbidden error.
public errorForbidden ( string $message = 'Forbidden' ) : void
$message string
Результат void

errorInternal() публичный Метод

Return a 500 internal server error.
public errorInternal ( string $message = 'Internal Error' ) : void
$message string
Результат void

errorMethodNotAllowed() публичный Метод

Return a 405 method not allowed error.
public errorMethodNotAllowed ( string $message = 'Method Not Allowed' ) : void
$message string
Результат void

errorNotFound() публичный Метод

Return a 404 not found error.
public errorNotFound ( string $message = 'Not Found' ) : void
$message string
Результат void

errorUnauthorized() публичный Метод

Return a 401 unauthorized error.
public errorUnauthorized ( string $message = 'Unauthorized' ) : void
$message string
Результат void

item() публичный Метод

Bind an item to a transformer and start building a response.
public item ( object $item, object $transformer, array $parameters = [], Closure $after = null ) : Response
$item object
$transformer object
$parameters array
$after Closure
Результат Dingo\Api\Http\Response

noContent() публичный Метод

Respond with a no content response.
public noContent ( ) : Response
Результат Dingo\Api\Http\Response

paginator() публичный Метод

Bind a paginator to a transformer and start building a response.
public paginator ( Illuminate\Contracts\Pagination\Paginator $paginator, object $transformer, array $parameters = [], Closure $after = null ) : Response
$paginator Illuminate\Contracts\Pagination\Paginator
$transformer object
$parameters array
$after Closure
Результат Dingo\Api\Http\Response

Описание свойств

$transformer защищенное свойство

Transformer factory instance.
protected Factory,Dingo\Api\Transformer $transformer
Результат Dingo\Api\Transformer\Factory