PHP Interface Neomerx\JsonApi\Contracts\Schema\SchemaFactoryInterface

Datei anzeigen Open project: neomerx/json-api Interface Usage Examples

Public Methods

Method Description
createContainer ( array $providers = [] ) : Neomerx\JsonApi\Contracts\Schema\ContainerInterface Create schema provider container.
createIdentitySchema ( Neomerx\JsonApi\Contracts\Schema\ContainerInterface $container, string $classType, Closure $identityClosure ) : Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface Create schema for identity objects.
createLink ( string $subHref, array | object | null $meta = null, boolean $treatAsHref = false ) : Neomerx\JsonApi\Contracts\Document\LinkInterface Create link.
createRelationshipObject ( string $name, object | array | null $data, \Neomerx\JsonApi\Contracts\Schema\LinkInterface>\array $links, mixed $meta, boolean $isShowData, boolean $isRoot ) : Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface Create relationship object.
createResourceIdentifierContainerAdapter ( Neomerx\JsonApi\Contracts\Schema\ContainerInterface $container ) : Neomerx\JsonApi\Contracts\Schema\ContainerInterface Create adapter for schema provider container that returns 'resource identifiers' schemes.
createResourceIdentifierSchemaAdapter ( Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface $schema ) : Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface Create an adapter for schema that will provide data to encode them as resource identifiers.
createResourceObject ( Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface $schema, object $resource, boolean $isInArray, int>\arraynull $attributeKeysFilter = null ) : Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface Create resource object.

Method Details

createContainer() public method

Create schema provider container.
public createContainer ( array $providers = [] ) : Neomerx\JsonApi\Contracts\Schema\ContainerInterface
$providers array
return Neomerx\JsonApi\Contracts\Schema\ContainerInterface

createIdentitySchema() public method

Create schema for identity objects.
public createIdentitySchema ( Neomerx\JsonApi\Contracts\Schema\ContainerInterface $container, string $classType, Closure $identityClosure ) : Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface
$container Neomerx\JsonApi\Contracts\Schema\ContainerInterface
$classType string
$identityClosure Closure function($resource) : string
return Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface

createRelationshipObject() public method

Create relationship object.
public createRelationshipObject ( string $name, object | array | null $data, \Neomerx\JsonApi\Contracts\Schema\LinkInterface>\array $links, mixed $meta, boolean $isShowData, boolean $isRoot ) : Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface
$name string
$data object | array | null
$links \Neomerx\JsonApi\Contracts\Schema\LinkInterface>\array
$meta mixed
$isShowData boolean
$isRoot boolean
return Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface

createResourceIdentifierContainerAdapter() public method

Create adapter for schema provider container that returns 'resource identifiers' schemes.
public createResourceIdentifierContainerAdapter ( Neomerx\JsonApi\Contracts\Schema\ContainerInterface $container ) : Neomerx\JsonApi\Contracts\Schema\ContainerInterface
$container Neomerx\JsonApi\Contracts\Schema\ContainerInterface
return Neomerx\JsonApi\Contracts\Schema\ContainerInterface

createResourceIdentifierSchemaAdapter() public method

Create an adapter for schema that will provide data to encode them as resource identifiers.
public createResourceIdentifierSchemaAdapter ( Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface $schema ) : Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface
$schema Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface
return Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface

createResourceObject() public method

Create resource object.
public createResourceObject ( Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface $schema, object $resource, boolean $isInArray, int>\arraynull $attributeKeysFilter = null ) : Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
$schema Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface
$resource object
$isInArray boolean
$attributeKeysFilter int>\arraynull
return Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface