PHP Класс Neomerx\JsonApi\Http\Responses

Наследование: implements Neomerx\JsonApi\Contracts\Http\ResponsesInterface
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
getCodeResponse ( $statusCode, array $headers = [] )
getContentResponse ( $data, $statusCode = self::HTTP_OK, $links = null, $meta = null, array $headers = [] )
getCreatedResponse ( $resource, $links = null, $meta = null, array $headers = [] )
getErrorResponse ( $errors, $statusCode = self::HTTP_BAD_REQUEST, array $headers = [] )
getIdentifiersResponse ( $data, $statusCode = self::HTTP_OK, $links = null, $meta = null, array $headers = [] )
getMetaResponse ( $meta, $statusCode = self::HTTP_OK, array $headers = [] )

Защищенные методы

Метод Описание
createJsonApiResponse ( string | null $content, integer $statusCode, array $headers = [] ) : mixed
createResponse ( string | null $content, integer $statusCode, array $headers ) : mixed Create HTTP response.
getEncoder ( ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface
getEncodingParameters ( ) : Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface | null
getMediaType ( ) : Neomerx\JsonApi\Contracts\Http\Headers\MediaTypeInterface
getResourceLocationUrl ( mixed $resource ) : string
getSchemaContainer ( ) : Neomerx\JsonApi\Contracts\Schema\ContainerInterface
getSupportedExtensions ( ) : Neomerx\JsonApi\Contracts\Http\Headers\SupportedExtensionsInterface | null
getUrlPrefix ( ) : string | null

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

createJsonApiResponse() защищенный Метод

protected createJsonApiResponse ( string | null $content, integer $statusCode, array $headers = [] ) : mixed
$content string | null
$statusCode integer
$headers array
Результат mixed

createResponse() абстрактный защищенный Метод

Create HTTP response.
abstract protected createResponse ( string | null $content, integer $statusCode, array $headers ) : mixed
$content string | null
$statusCode integer
$headers array
Результат mixed

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

public getCodeResponse ( $statusCode, array $headers = [] )
$headers array

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

public getContentResponse ( $data, $statusCode = self::HTTP_OK, $links = null, $meta = null, array $headers = [] )
$headers array

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

public getCreatedResponse ( $resource, $links = null, $meta = null, array $headers = [] )
$headers array

getEncoder() абстрактный защищенный Метод

abstract protected getEncoder ( ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface
Результат Neomerx\JsonApi\Contracts\Encoder\EncoderInterface

getEncodingParameters() абстрактный защищенный Метод

abstract protected getEncodingParameters ( ) : Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface | null
Результат Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface | null

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

public getErrorResponse ( $errors, $statusCode = self::HTTP_BAD_REQUEST, array $headers = [] )
$headers array

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

public getIdentifiersResponse ( $data, $statusCode = self::HTTP_OK, $links = null, $meta = null, array $headers = [] )
$headers array

getMediaType() абстрактный защищенный Метод

abstract protected getMediaType ( ) : Neomerx\JsonApi\Contracts\Http\Headers\MediaTypeInterface
Результат Neomerx\JsonApi\Contracts\Http\Headers\MediaTypeInterface

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

public getMetaResponse ( $meta, $statusCode = self::HTTP_OK, array $headers = [] )
$headers array

getResourceLocationUrl() защищенный Метод

protected getResourceLocationUrl ( mixed $resource ) : string
$resource mixed
Результат string

getSchemaContainer() абстрактный защищенный Метод

abstract protected getSchemaContainer ( ) : Neomerx\JsonApi\Contracts\Schema\ContainerInterface
Результат Neomerx\JsonApi\Contracts\Schema\ContainerInterface

getSupportedExtensions() абстрактный защищенный Метод

abstract protected getSupportedExtensions ( ) : Neomerx\JsonApi\Contracts\Http\Headers\SupportedExtensionsInterface | null
Результат Neomerx\JsonApi\Contracts\Http\Headers\SupportedExtensionsInterface | null

getUrlPrefix() абстрактный защищенный Метод

abstract protected getUrlPrefix ( ) : string | null
Результат string | null