PHP Interface Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface

Exibir arquivo Open project: neomerx/json-api Interface Usage Examples

Public Methods

Method Description
createResourceObject ( object $resource, boolean $isOriginallyArrayed, $attributeKeysFilter = null ) : Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface Create resource object.
getAttributes ( object $resource ) : array Get resource attributes.
getId ( object $resource ) : string Get resource identity.
getIncludePaths ( ) : string[] Get schema default include paths.
getIncludedResourceLinks ( mixed $resource ) : array Get links related to resource when it is in 'included' section.
getInclusionMeta ( object $resource ) : mixed Get meta when resource is within included resources.
getLinkageMeta ( object $resource ) : mixed Get meta when resource is within relationship of a primary resource.
getPrimaryMeta ( object $resource ) : mixed Get meta when resource is primary (top level 'data' section).
getRelationshipObjectIterator ( object $resource, boolean $isPrimary, array $includeRelationships ) : Iterator Get resource's relationship objects.
getRelationshipRelatedLink ( object $resource, string $name, null | mixed $meta = null, boolean $treatAsHref = false ) : Neomerx\JsonApi\Contracts\Document\LinkInterface Get 'related' URL link to resource relationship.
getRelationshipSelfLink ( object $resource, string $name, null | mixed $meta = null, boolean $treatAsHref = false ) : Neomerx\JsonApi\Contracts\Document\LinkInterface Get 'self' URL link to resource relationship.
getRelationshipsInclusionMeta ( object $resource ) : mixed Get get relationships meta when the resource is within included.
getRelationshipsPrimaryMeta ( object $resource ) : mixed Get get relationships meta when the resource is primary.
getResourceLinks ( mixed $resource ) : array Get links related to resource.
getResourceType ( ) : string Get resource type.
getSelfSubLink ( object $resource ) : Neomerx\JsonApi\Contracts\Document\LinkInterface Get resource URL link.
getSelfSubUrl ( object | null $resource = null ) : string Get resource sub URL.
isShowAttributesInIncluded ( ) : boolean If resource attributes should be shown when the resource is within 'included'.

Method Details

createResourceObject() public method

Create resource object.
public createResourceObject ( object $resource, boolean $isOriginallyArrayed, $attributeKeysFilter = null ) : Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
$resource object
$isOriginallyArrayed boolean
return Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface

getAttributes() public method

Get resource attributes.
public getAttributes ( object $resource ) : array
$resource object
return array

getId() public method

Get resource identity.
public getId ( object $resource ) : string
$resource object
return string

getIncludePaths() public method

Get schema default include paths.
public getIncludePaths ( ) : string[]
return string[]

getInclusionMeta() public method

Get meta when resource is within included resources.
public getInclusionMeta ( object $resource ) : mixed
$resource object
return mixed

getLinkageMeta() public method

Get meta when resource is within relationship of a primary resource.
public getLinkageMeta ( object $resource ) : mixed
$resource object
return mixed

getPrimaryMeta() public method

Get meta when resource is primary (top level 'data' section).
public getPrimaryMeta ( object $resource ) : mixed
$resource object
return mixed

getRelationshipObjectIterator() public method

Get resource's relationship objects.
public getRelationshipObjectIterator ( object $resource, boolean $isPrimary, array $includeRelationships ) : Iterator
$resource object
$isPrimary boolean
$includeRelationships array
return Iterator RelationshipObjectInterface[]

getRelationshipsInclusionMeta() public method

Get get relationships meta when the resource is within included.
public getRelationshipsInclusionMeta ( object $resource ) : mixed
$resource object
return mixed

getRelationshipsPrimaryMeta() public method

Get get relationships meta when the resource is primary.
public getRelationshipsPrimaryMeta ( object $resource ) : mixed
$resource object
return mixed

getResourceType() public method

Get resource type.
public getResourceType ( ) : string
return string

getSelfSubUrl() public method

Get resource sub URL.
public getSelfSubUrl ( object | null $resource = null ) : string
$resource object | null
return string

isShowAttributesInIncluded() public method

If resource attributes should be shown when the resource is within 'included'.