PHP 인터페이스 Neomerx\JsonApi\Contracts\Document\DocumentInterface

파일 보기 프로젝트 열기: neomerx/json-api 0 사용 예제들

공개 메소드들

메소드 설명
addEmptyRelationshipToData ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship ) : void Add an empty relationship to resource in 'data' section.
addEmptyRelationshipToIncluded ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship ) : void Add an empty relationship to resource in 'included' section.
addError ( Neomerx\JsonApi\Contracts\Document\ErrorInterface $error ) : void Add information to 'errors' top-level section.
addErrors ( Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | ErrorCollection $errors ) : void Add information to 'errors' top-level section.
addJsonApiVersion ( string $version, mixed | null $meta = null ) : void Add JSON API version information.
addNullRelationshipToData ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship ) : void Add a null relationship to resource in 'data' section.
addNullRelationshipToIncluded ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship ) : void Add a null relationship to resource in 'included' section.
addRelationshipToData ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship, Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void Add a relationship to resource in 'data' section.
addRelationshipToIncluded ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship, Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void Add a relationship to resource in 'included' section.
addToData ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void Add resource to 'data' section.
addToIncluded ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void Add resource to 'included' section.
getDocument ( ) : array Get document as array.
setDocumentLinks ( LinkInterface>\arraynull $links ) : void Set URLs to top-level 'links' section.
setEmptyData ( ) : void Set empty array to 'data' section.
setMetaToDocument ( object | array $meta ) : void Set arbitrary meta-information about primary data to top-level 'meta' section.
setNullData ( ) : void Set null to 'data' section.
setResourceCompleted ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void Mark resource as completed (no new relations/links/etc will be added to the resource anymore).
setUrlPrefix ( string $prefix ) : void Set a prefix that will be applied to all URLs in the document except marked as href.
unsetData ( ) : void Remove 'data' top-level section.

메소드 상세

addEmptyRelationshipToData() 공개 메소드

Add an empty relationship to resource in 'data' section.
public addEmptyRelationshipToData ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship ) : void
$parent Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
$relationship Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface
리턴 void

addEmptyRelationshipToIncluded() 공개 메소드

Add an empty relationship to resource in 'included' section.
public addEmptyRelationshipToIncluded ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship ) : void
$parent Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
$relationship Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface
리턴 void

addError() 공개 메소드

If you add error information no other elements will be in output document.
public addError ( Neomerx\JsonApi\Contracts\Document\ErrorInterface $error ) : void
$error Neomerx\JsonApi\Contracts\Document\ErrorInterface
리턴 void

addErrors() 공개 메소드

If you add errors information no other elements will be in output document.
public addErrors ( Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | ErrorCollection $errors ) : void
$errors Neomerx\JsonApi\Contracts\Document\ErrorInterface[] | Neomerx\JsonApi\Exceptions\ErrorCollection
리턴 void

addJsonApiVersion() 공개 메소드

Add JSON API version information.
public addJsonApiVersion ( string $version, mixed | null $meta = null ) : void
$version string
$meta mixed | null
리턴 void

addNullRelationshipToData() 공개 메소드

Add a null relationship to resource in 'data' section.
public addNullRelationshipToData ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship ) : void
$parent Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
$relationship Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface
리턴 void

addNullRelationshipToIncluded() 공개 메소드

Add a null relationship to resource in 'included' section.
public addNullRelationshipToIncluded ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship ) : void
$parent Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
$relationship Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface
리턴 void

addRelationshipToData() 공개 메소드

Add a relationship to resource in 'data' section.
public addRelationshipToData ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship, Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void
$parent Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
$relationship Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface
$resource Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
리턴 void

addRelationshipToIncluded() 공개 메소드

Add a relationship to resource in 'included' section.
public addRelationshipToIncluded ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $parent, Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface $relationship, Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void
$parent Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
$relationship Neomerx\JsonApi\Contracts\Schema\RelationshipObjectInterface
$resource Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
리턴 void

addToData() 공개 메소드

Add resource to 'data' section.
public addToData ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void
$resource Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
리턴 void

addToIncluded() 공개 메소드

Add resource to 'included' section.
public addToIncluded ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void
$resource Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
리턴 void

getDocument() 공개 메소드

Get document as array.
public getDocument ( ) : array
리턴 array

setEmptyData() 공개 메소드

Set empty array to 'data' section.
public setEmptyData ( ) : void
리턴 void

setMetaToDocument() 공개 메소드

Set arbitrary meta-information about primary data to top-level 'meta' section.
public setMetaToDocument ( object | array $meta ) : void
$meta object | array
리턴 void

setNullData() 공개 메소드

Set null to 'data' section.
public setNullData ( ) : void
리턴 void

setResourceCompleted() 공개 메소드

Mark resource as completed (no new relations/links/etc will be added to the resource anymore).
public setResourceCompleted ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void
$resource Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
리턴 void

setUrlPrefix() 공개 메소드

Set a prefix that will be applied to all URLs in the document except marked as href.
또한 보기: LinkInterface
public setUrlPrefix ( string $prefix ) : void
$prefix string
리턴 void

unsetData() 공개 메소드

Remove 'data' top-level section.
public unsetData ( ) : void
리턴 void