PHP Class Neomerx\JsonApi\Schema\SchemaProvider

Inheritance: implements Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface
显示文件 Open project: neomerx/json-api Class Usage Examples

Protected Properties

Property Type Description
$isShowAttributesInIncluded boolean
$resourceType string
$selfSubUrl Must start with '/' e.g. '/sub-url'

Public Methods

Method Description
__construct ( Neomerx\JsonApi\Contracts\Schema\SchemaFactoryInterface $factory )
createResourceObject ( $resource, $isOriginallyArrayed, $attributeKeysFilter = null )
getIncludePaths ( )
getIncludedResourceLinks ( $resource )
getInclusionMeta ( $resource )
getLinkageMeta ( $resource )
getPrimaryMeta ( $resource )
getRelationshipObjectIterator ( $resource, $isPrimary, array $includeRelationships )
getRelationshipRelatedLink ( $resource, $name, $meta = null, $treatAsHref = false )
getRelationshipSelfLink ( $resource, $name, $meta = null, $treatAsHref = false )
getRelationships ( object $resource, boolean $isPrimary, array $includeRelationships ) : array Get resource links.
getRelationshipsInclusionMeta ( $resource )
getRelationshipsPrimaryMeta ( $resource )
getResourceLinks ( $resource )
getResourceType ( )
getSelfSubLink ( $resource )
getSelfSubUrl ( $resource = null )
isShowAttributesInIncluded ( )

Protected Methods

Method Description
createLink ( string $subHref, null | mixed $meta = null, boolean $treatAsHref = false ) : Neomerx\JsonApi\Contracts\Document\LinkInterface
createRelationshipObject ( object $resource, string $name, array $desc ) : Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface
getRelationshipRelatedUrl ( object $resource, string $name ) : string
getRelationshipSelfUrl ( object $resource, string $name ) : string
readLinks ( object $resource, string $relationshipName, array $description, boolean $isShowSelf, boolean $isShowRelated ) : array

Private Methods

Method Description
getValue ( array $array, string $key, mixed $default = null ) : mixed

Method Details

__construct() public method

public __construct ( Neomerx\JsonApi\Contracts\Schema\SchemaFactoryInterface $factory )
$factory Neomerx\JsonApi\Contracts\Schema\SchemaFactoryInterface

createRelationshipObject() protected method

protected createRelationshipObject ( object $resource, string $name, array $desc ) : Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface
$resource object
$name string
$desc array
return Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface

createResourceObject() public method

public createResourceObject ( $resource, $isOriginallyArrayed, $attributeKeysFilter = null )

getIncludePaths() public method

public getIncludePaths ( )

getInclusionMeta() public method

public getInclusionMeta ( $resource )

getLinkageMeta() public method

public getLinkageMeta ( $resource )

getPrimaryMeta() public method

public getPrimaryMeta ( $resource )

getRelationshipObjectIterator() public method

public getRelationshipObjectIterator ( $resource, $isPrimary, array $includeRelationships )
$includeRelationships array

getRelationshipRelatedUrl() protected method

protected getRelationshipRelatedUrl ( object $resource, string $name ) : string
$resource object
$name string
return string

getRelationshipSelfUrl() protected method

protected getRelationshipSelfUrl ( object $resource, string $name ) : string
$resource object
$name string
return string

getRelationships() public method

Get resource links.
public getRelationships ( object $resource, boolean $isPrimary, array $includeRelationships ) : array
$resource object
$isPrimary boolean
$includeRelationships array A list of relationships that will be included as full resources.
return array

getRelationshipsInclusionMeta() public method

public getRelationshipsInclusionMeta ( $resource )

getRelationshipsPrimaryMeta() public method

public getRelationshipsPrimaryMeta ( $resource )

getResourceType() public method

public getResourceType ( )

getSelfSubUrl() public method

public getSelfSubUrl ( $resource = null )

isShowAttributesInIncluded() public method

Property Details

$isShowAttributesInIncluded protected_oe property

protected bool $isShowAttributesInIncluded
return boolean

$resourceType protected_oe property

protected string $resourceType
return string

$selfSubUrl protected_oe property

Must start with '/' e.g. '/sub-url'
protected $selfSubUrl