Method | Description | |
---|---|---|
encodeData ( object | array | Iterato\Iterator | null $data, Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface $parameters = null ) : string | Encode input as JSON API string. | |
encodeError ( Neomerx\JsonApi\Contracts\Document\ErrorInterface $error ) : string | Encode error as JSON API string. | |
encodeErrors ( Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | |
Encode errors as JSON API string. | |
encodeIdentifiers ( object | array | Iterato\Iterator | null $data, Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface $parameters = null ) : string | Encode input as JSON API string with a list of resource identifiers. | |
encodeMeta ( array | object $meta ) : string | Encode input meta as JSON API string. | |
withJsonApiVersion ( mixed | null $meta = null ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface | If called JSON API version information with optional meta will be added to a document. | |
withLinks ( array $links ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface |
Add links that will be encoded with data. Links must be in array |
|
withMeta ( mixed | null $meta ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface | Add meta information that will be encoded with data. If 'null' meta will not appear in a document. | |
withRelationshipRelatedLink ( object $resource, string $relationshipName, null | mixed $meta = null, boolean $treatAsHref = false ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface | Add 'related' Link to top-level document's 'links' section for relationship specified. | |
withRelationshipSelfLink ( object $resource, string $relationshipName, null | mixed $meta = null, boolean $treatAsHref = false ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface | Add 'self' Link to top-level document's 'links' section for relationship specified. |
public encodeData ( object | array | Iterato\Iterator | null $data, Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface $parameters = null ) : string | ||
$data | object | array | Iterato\Iterator | null | Data to encode. |
$parameters | Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface | Encoding parameters. |
return | string |
public encodeError ( Neomerx\JsonApi\Contracts\Document\ErrorInterface $error ) : string | ||
$error | Neomerx\JsonApi\Contracts\Document\ErrorInterface | |
return | string |
public encodeErrors ( Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | |
||
$errors | Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | |
|
return | string |
public encodeIdentifiers ( object | array | Iterato\Iterator | null $data, Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface $parameters = null ) : string | ||
$data | object | array | Iterato\Iterator | null | Data to encode. |
$parameters | Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface | Encoding parameters. |
return | string |
public withJsonApiVersion ( mixed | null $meta = null ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface | ||
$meta | mixed | null | |
return | Neomerx\JsonApi\Contracts\Encoder\EncoderInterface |
public withRelationshipRelatedLink ( object $resource, string $relationshipName, null | mixed $meta = null, boolean $treatAsHref = false ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface | ||
$resource | object | |
$relationshipName | string | |
$meta | null | mixed | |
$treatAsHref | boolean | |
return | Neomerx\JsonApi\Contracts\Encoder\EncoderInterface |
public withRelationshipSelfLink ( object $resource, string $relationshipName, null | mixed $meta = null, boolean $treatAsHref = false ) : Neomerx\JsonApi\Contracts\Encoder\EncoderInterface | ||
$resource | object | |
$relationshipName | string | |
$meta | null | mixed | |
$treatAsHref | boolean | |
return | Neomerx\JsonApi\Contracts\Encoder\EncoderInterface |