PHP Class WoohooLabs\Yin\JsonApi\Document\AbstractSuccessfulDocument

Inheritance: extends AbstractDocument
显示文件 Open project: woohoolabs/yin Class Usage Examples

Protected Properties

Property Type Description
$domainObject mixed

Public Methods

Method Description
getMetaResponse ( WoohooLabs\Yin\JsonApi\Request\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface $exceptionFactory, WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface $serializer, mixed $domainObject, integer $responseCode, array $additionalMeta = [] ) : Psr\Http\Message\ResponseInterface Returns a response with a status code of $responseCode, only containing meta information (without the "data" and the "included" sections) about the document, assembled based on the $domainObject. You can also pass additional meta information to the document in the $additionalMeta argument.
getRelationshipResponse ( string $relationshipName, WoohooLabs\Yin\JsonApi\Request\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface $exceptionFactory, WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface $serializer, mixed $domainObject, integer $responseCode, array $additionalMeta = [] ) : Psr\Http\Message\ResponseInterface Returns a response with a status code of $responseCode, containing the $relationshipName relationship object as the primary data, assembled based on the $domainObject. You can also pass additional meta information to the document in the $additionalMeta argument.
getResponse ( WoohooLabs\Yin\JsonApi\Request\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface $exceptionFactory, WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface $serializer, mixed $domainObject, integer $responseCode, array $additionalMeta = [] ) : Psr\Http\Message\ResponseInterface Returns a response with a status code of $responseCode, containing all the provided sections of the document, assembled based on the $domainObject. You can also pass additional meta information for the document in the $additionalMeta argument.

Protected Methods

Method Description
createData ( ) : WoohooLabs\Yin\JsonApi\Schema\Data\DataInterface
fillData ( Transformation $transformation ) Fills the transformation data based on the "domainObject" property.
getRelationshipContent ( string $relationshipName, Transformation $transformation, array $additionalMeta = [] ) : array Returns a response content whose primary data is a relationship object with $relationshipName name. You can also pass additional meta information for the document in the $additionalMeta argument.
transformContent ( Transformation $transformation, array $additionalMeta = [] ) : array
transformRelationshipContent ( string $relationshipName, Transformation $transformation, array $additionalMeta = [] ) : array

Private Methods

Method Description
initializeDocument ( mixed $domainObject )

Method Details

createData() abstract protected method

abstract protected createData ( ) : WoohooLabs\Yin\JsonApi\Schema\Data\DataInterface
return WoohooLabs\Yin\JsonApi\Schema\Data\DataInterface

fillData() abstract protected method

Fills the transformation data based on the "domainObject" property.
abstract protected fillData ( Transformation $transformation )
$transformation WoohooLabs\Yin\JsonApi\Transformer\Transformation

getMetaResponse() public method

Returns a response with a status code of $responseCode, only containing meta information (without the "data" and the "included" sections) about the document, assembled based on the $domainObject. You can also pass additional meta information to the document in the $additionalMeta argument.
public getMetaResponse ( WoohooLabs\Yin\JsonApi\Request\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface $exceptionFactory, WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface $serializer, mixed $domainObject, integer $responseCode, array $additionalMeta = [] ) : Psr\Http\Message\ResponseInterface
$request WoohooLabs\Yin\JsonApi\Request\RequestInterface
$response Psr\Http\Message\ResponseInterface
$exceptionFactory WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface
$serializer WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface
$domainObject mixed
$responseCode integer
$additionalMeta array
return Psr\Http\Message\ResponseInterface

getRelationshipContent() abstract protected method

Returns a response content whose primary data is a relationship object with $relationshipName name. You can also pass additional meta information for the document in the $additionalMeta argument.
abstract protected getRelationshipContent ( string $relationshipName, Transformation $transformation, array $additionalMeta = [] ) : array
$relationshipName string
$transformation WoohooLabs\Yin\JsonApi\Transformer\Transformation
$additionalMeta array
return array

getRelationshipResponse() public method

Returns a response with a status code of $responseCode, containing the $relationshipName relationship object as the primary data, assembled based on the $domainObject. You can also pass additional meta information to the document in the $additionalMeta argument.
public getRelationshipResponse ( string $relationshipName, WoohooLabs\Yin\JsonApi\Request\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface $exceptionFactory, WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface $serializer, mixed $domainObject, integer $responseCode, array $additionalMeta = [] ) : Psr\Http\Message\ResponseInterface
$relationshipName string
$request WoohooLabs\Yin\JsonApi\Request\RequestInterface
$response Psr\Http\Message\ResponseInterface
$exceptionFactory WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface
$serializer WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface
$domainObject mixed
$responseCode integer
$additionalMeta array
return Psr\Http\Message\ResponseInterface

getResponse() public method

Returns a response with a status code of $responseCode, containing all the provided sections of the document, assembled based on the $domainObject. You can also pass additional meta information for the document in the $additionalMeta argument.
public getResponse ( WoohooLabs\Yin\JsonApi\Request\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface $exceptionFactory, WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface $serializer, mixed $domainObject, integer $responseCode, array $additionalMeta = [] ) : Psr\Http\Message\ResponseInterface
$request WoohooLabs\Yin\JsonApi\Request\RequestInterface
$response Psr\Http\Message\ResponseInterface
$exceptionFactory WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface
$serializer WoohooLabs\Yin\JsonApi\Serializer\SerializerInterface
$domainObject mixed
$responseCode integer
$additionalMeta array
return Psr\Http\Message\ResponseInterface

transformContent() protected method

protected transformContent ( Transformation $transformation, array $additionalMeta = [] ) : array
$transformation WoohooLabs\Yin\JsonApi\Transformer\Transformation
$additionalMeta array
return array

transformRelationshipContent() protected method

protected transformRelationshipContent ( string $relationshipName, Transformation $transformation, array $additionalMeta = [] ) : array
$relationshipName string
$transformation WoohooLabs\Yin\JsonApi\Transformer\Transformation
$additionalMeta array
return array

Property Details

$domainObject protected_oe property

protected mixed $domainObject
return mixed