PHP Class Neomerx\JsonApi\Http\Responses

Inheritance: implements Neomerx\JsonApi\Contracts\Http\ResponsesInterface
Afficher le fichier Open project: neomerx/json-api Class Usage Examples

Méthodes publiques

Méthode Description
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 = [] )

Méthodes protégées

Méthode Description
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

Method Details

createJsonApiResponse() protected méthode

protected createJsonApiResponse ( string | null $content, integer $statusCode, array $headers = [] ) : mixed
$content string | null
$statusCode integer
$headers array
Résultat mixed

createResponse() abstract protected méthode

Create HTTP response.
abstract protected createResponse ( string | null $content, integer $statusCode, array $headers ) : mixed
$content string | null
$statusCode integer
$headers array
Résultat mixed

getCodeResponse() public méthode

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

getContentResponse() public méthode

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

getCreatedResponse() public méthode

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

getEncoder() abstract protected méthode

abstract protected getEncoder ( ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface
Résultat Neomerx\JsonApi\Contracts\Encoder\EncoderInterface

getEncodingParameters() abstract protected méthode

abstract protected getEncodingParameters ( ) : Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface | null
Résultat Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface | null

getErrorResponse() public méthode

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

getIdentifiersResponse() public méthode

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

getMediaType() abstract protected méthode

abstract protected getMediaType ( ) : Neomerx\JsonApi\Contracts\Http\Headers\MediaTypeInterface
Résultat Neomerx\JsonApi\Contracts\Http\Headers\MediaTypeInterface

getMetaResponse() public méthode

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

getResourceLocationUrl() protected méthode

protected getResourceLocationUrl ( mixed $resource ) : string
$resource mixed
Résultat string

getSchemaContainer() abstract protected méthode

abstract protected getSchemaContainer ( ) : Neomerx\JsonApi\Contracts\Schema\ContainerInterface
Résultat Neomerx\JsonApi\Contracts\Schema\ContainerInterface

getSupportedExtensions() abstract protected méthode

abstract protected getSupportedExtensions ( ) : Neomerx\JsonApi\Contracts\Http\Headers\SupportedExtensionsInterface | null
Résultat Neomerx\JsonApi\Contracts\Http\Headers\SupportedExtensionsInterface | null

getUrlPrefix() abstract protected méthode

abstract protected getUrlPrefix ( ) : string | null
Résultat string | null