PHP 클래스 Neomerx\JsonApi\Encoder\Parser\Parser

Parser helps to filter resource attributes at the moment of their creation. ^^^^ This is 'sparse' JSON API feature and 'fields set' feature (for attributes) Parser does not decide if particular resource or its relationships are actually added to final JSON document. Parsing reply interpreter does this job. Parser interpreter might not include some intermediate resources that parser has found while reaching targets. ^^^^ This is 'sparse' JSON API feature again and 'fields set' feature (for relationships) The final JSON view of an element is chosen by document which uses settings to decide if 'self', 'meta', and other members should be rendered. ^^^^ This is generic JSON API features Once again, it basically works this way: - Parser finds all targeted relationships and outputs them with all intermediate results (looks like a tree). Resource attributes are already filtered. - Reply interpreter filters intermediate results and resource relationships and then send it to document. - The document is just a renderer which saves the input data in one of a few variations depending on settings. - When all data are parsed the document converts collected data to json.
상속: implements Neomerx\JsonApi\Contracts\Encoder\Parser\ParserInterface
파일 보기 프로젝트 열기: neomerx/json-api 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$container Neomerx\JsonApi\Contracts\Schema\ContainerInterface
$manager Neomerx\JsonApi\Contracts\Encoder\Parser\ParserManagerInterface
$parserFactory Neomerx\JsonApi\Contracts\Encoder\Parser\ParserFactoryInterface
$schemaFactory Neomerx\JsonApi\Contracts\Schema\SchemaFactoryInterface
$stack Neomerx\JsonApi\Contracts\Encoder\Stack\StackInterface
$stackFactory Neomerx\JsonApi\Contracts\Encoder\Stack\StackFactoryInterface

공개 메소드들

메소드 설명
__construct ( Neomerx\JsonApi\Contracts\Encoder\Parser\ParserFactoryInterface $parserFactory, Neomerx\JsonApi\Contracts\Encoder\Stack\StackFactoryInterface $stackFactory, Neomerx\JsonApi\Contracts\Schema\SchemaFactoryInterface $schemaFactory, Neomerx\JsonApi\Contracts\Schema\ContainerInterface $container, Neomerx\JsonApi\Contracts\Encoder\Parser\ParserManagerInterface $manager )
parse ( $data )

보호된 메소드들

메소드 설명
analyzeCurrentData ( ) : array
analyzeData ( array | null | object $data ) : array
getCurrentData ( ) : array | null | object

비공개 메소드들

메소드 설명
checkCircular ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resourceObject ) : boolean
createReplyForEmptyData ( array | null $data ) : Neomerx\JsonApi\Contracts\Encoder\Parser\ParserReplyInterface
createReplyResourceCompleted ( ) : Neomerx\JsonApi\Contracts\Encoder\Parser\ParserReplyInterface
createReplyResourceStarted ( ) : Neomerx\JsonApi\Contracts\Encoder\Parser\ParserReplyInterface
getFieldSet ( string $resourceType ) : array
getIncludeRelationships ( ) : string[]
getSchema ( mixed $resource, Neomerx\JsonApi\Contracts\Encoder\Stack\StackFrameReadOnlyInterface $frame ) : Neomerx\JsonApi\Contracts\Schema\SchemaProviderInterface
isRelationshipIncludedOrInFieldSet ( ) : boolean
parseData ( ) : Iterator
shouldParseRelationships ( ) : boolean

메소드 상세

__construct() 공개 메소드

public __construct ( Neomerx\JsonApi\Contracts\Encoder\Parser\ParserFactoryInterface $parserFactory, Neomerx\JsonApi\Contracts\Encoder\Stack\StackFactoryInterface $stackFactory, Neomerx\JsonApi\Contracts\Schema\SchemaFactoryInterface $schemaFactory, Neomerx\JsonApi\Contracts\Schema\ContainerInterface $container, Neomerx\JsonApi\Contracts\Encoder\Parser\ParserManagerInterface $manager )
$parserFactory Neomerx\JsonApi\Contracts\Encoder\Parser\ParserFactoryInterface
$stackFactory Neomerx\JsonApi\Contracts\Encoder\Stack\StackFactoryInterface
$schemaFactory Neomerx\JsonApi\Contracts\Schema\SchemaFactoryInterface
$container Neomerx\JsonApi\Contracts\Schema\ContainerInterface
$manager Neomerx\JsonApi\Contracts\Encoder\Parser\ParserManagerInterface

analyzeCurrentData() 보호된 메소드

protected analyzeCurrentData ( ) : array
리턴 array

analyzeData() 보호된 메소드

protected analyzeData ( array | null | object $data ) : array
$data array | null | object
리턴 array

getCurrentData() 보호된 메소드

protected getCurrentData ( ) : array | null | object
리턴 array | null | object

parse() 공개 메소드

public parse ( $data )

프로퍼티 상세

$container 보호되어 있는 프로퍼티

protected ContainerInterface,Neomerx\JsonApi\Contracts\Schema $container
리턴 Neomerx\JsonApi\Contracts\Schema\ContainerInterface

$manager 보호되어 있는 프로퍼티

protected ParserManagerInterface,Neomerx\JsonApi\Contracts\Encoder\Parser $manager
리턴 Neomerx\JsonApi\Contracts\Encoder\Parser\ParserManagerInterface

$parserFactory 보호되어 있는 프로퍼티

protected ParserFactoryInterface,Neomerx\JsonApi\Contracts\Encoder\Parser $parserFactory
리턴 Neomerx\JsonApi\Contracts\Encoder\Parser\ParserFactoryInterface

$schemaFactory 보호되어 있는 프로퍼티

protected SchemaFactoryInterface,Neomerx\JsonApi\Contracts\Schema $schemaFactory
리턴 Neomerx\JsonApi\Contracts\Schema\SchemaFactoryInterface

$stack 보호되어 있는 프로퍼티

protected StackInterface,Neomerx\JsonApi\Contracts\Encoder\Stack $stack
리턴 Neomerx\JsonApi\Contracts\Encoder\Stack\StackInterface

$stackFactory 보호되어 있는 프로퍼티

protected StackFactoryInterface,Neomerx\JsonApi\Contracts\Encoder\Stack $stackFactory
리턴 Neomerx\JsonApi\Contracts\Encoder\Stack\StackFactoryInterface