PHP Class WoohooLabs\Yin\JsonApi\Document\AbstractErrorDocument

Inheritance: extends AbstractDocument
Mostra file Open project: woohoolabs/yin Class Usage Examples

Protected Properties

Property Type Description
$errors WoohooLabs\Yin\JsonApi\Schema\Error[]

Public Methods

Method Description
addError ( WoohooLabs\Yin\JsonApi\Schema\Error $error ) Includes a new error in the error document.
getErrors ( ) : WoohooLabs\Yin\JsonApi\Schema\Error[]
getResponse ( WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface $serializer, Psr\Http\Message\ResponseInterface $response, integer $responseCode = null, array $additionalMeta = [] ) : Psr\Http\Message\ResponseInterface Returns a response with a status code of $responseCode, containing all the provided sections of the error document. You can also pass additional meta information for the document in the $additionalMeta argument.
transformContent ( array $additionalMeta = [] ) : array

Protected Methods

Method Description
getResponseCode ( integer $responseCode ) : integer

Method Details

addError() public method

Includes a new error in the error document.
public addError ( WoohooLabs\Yin\JsonApi\Schema\Error $error )
$error WoohooLabs\Yin\JsonApi\Schema\Error

getErrors() public method

public getErrors ( ) : WoohooLabs\Yin\JsonApi\Schema\Error[]
return WoohooLabs\Yin\JsonApi\Schema\Error[]

getResponse() public method

Returns a response with a status code of $responseCode, containing all the provided sections of the error document. You can also pass additional meta information for the document in the $additionalMeta argument.
public getResponse ( WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface $serializer, Psr\Http\Message\ResponseInterface $response, integer $responseCode = null, array $additionalMeta = [] ) : Psr\Http\Message\ResponseInterface
$serializer WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface
$response Psr\Http\Message\ResponseInterface
$responseCode integer
$additionalMeta array
return Psr\Http\Message\ResponseInterface

getResponseCode() protected method

protected getResponseCode ( integer $responseCode ) : integer
$responseCode integer
return integer

transformContent() public method

public transformContent ( array $additionalMeta = [] ) : array
$additionalMeta array
return array

Property Details

$errors protected_oe property

protected Error[],WoohooLabs\Yin\JsonApi\Schema $errors
return WoohooLabs\Yin\JsonApi\Schema\Error[]