PHP Интерфейс Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface

Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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'.

Описание методов

createResourceObject() публичный Метод

Create resource object.
public createResourceObject ( object $resource, boolean $isOriginallyArrayed, $attributeKeysFilter = null ) : Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
$resource object
$isOriginallyArrayed boolean
Результат Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface

getAttributes() публичный Метод

Get resource attributes.
public getAttributes ( object $resource ) : array
$resource object
Результат array

getId() публичный Метод

Get resource identity.
public getId ( object $resource ) : string
$resource object
Результат string

getIncludePaths() публичный Метод

Get schema default include paths.
public getIncludePaths ( ) : string[]
Результат string[]

getInclusionMeta() публичный Метод

Get meta when resource is within included resources.
public getInclusionMeta ( object $resource ) : mixed
$resource object
Результат mixed

getLinkageMeta() публичный Метод

Get meta when resource is within relationship of a primary resource.
public getLinkageMeta ( object $resource ) : mixed
$resource object
Результат mixed

getPrimaryMeta() публичный Метод

Get meta when resource is primary (top level 'data' section).
public getPrimaryMeta ( object $resource ) : mixed
$resource object
Результат mixed

getRelationshipObjectIterator() публичный Метод

Get resource's relationship objects.
public getRelationshipObjectIterator ( object $resource, boolean $isPrimary, array $includeRelationships ) : Iterator
$resource object
$isPrimary boolean
$includeRelationships array
Результат Iterator RelationshipObjectInterface[]

getRelationshipsInclusionMeta() публичный Метод

Get get relationships meta when the resource is within included.
public getRelationshipsInclusionMeta ( object $resource ) : mixed
$resource object
Результат mixed

getRelationshipsPrimaryMeta() публичный Метод

Get get relationships meta when the resource is primary.
public getRelationshipsPrimaryMeta ( object $resource ) : mixed
$resource object
Результат mixed

getResourceType() публичный Метод

Get resource type.
public getResourceType ( ) : string
Результат string

getSelfSubUrl() публичный Метод

Get resource sub URL.
public getSelfSubUrl ( object | null $resource = null ) : string
$resource object | null
Результат string

isShowAttributesInIncluded() публичный Метод

If resource attributes should be shown when the resource is within 'included'.
public isShowAttributesInIncluded ( ) : boolean
Результат boolean