PHP Class Neomerx\JsonApi\Encoder\Parameters\ParametersAnalyzer

Inheritance: implements Neomerx\JsonApi\Contracts\Encoder\Parameters\ParametersAnalyzerInterface
ファイルを表示 Open project: neomerx/json-api Class Usage Examples

Public Methods

Method Description
__construct ( Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface $parameters, Neomerx\JsonApi\Contracts\Schema\ContainerInterface $container ) Constructor.
getIncludeRelationships ( $path, $type )
getParameters ( )
hasSomeFields ( $type )
isPathIncluded ( $path, $type )

Protected Methods

Method Description
hasExactPathMatch ( array $paths, string $path ) : boolean If path has exact match with one of the 'include' paths.
hasMatchWithIncludedPaths ( array $paths, string $path ) : boolean If path matches one of the included paths.

Private Methods

Method Description
getIncludePathsByType ( string $type ) : string[]
getRelationshipNameForResource ( string $curPath, integer $pathLength ) : string
getRelationshipNameForTopResource ( string $curPath ) : string

Method Details

__construct() public method

Constructor.
public __construct ( Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface $parameters, Neomerx\JsonApi\Contracts\Schema\ContainerInterface $container )
$parameters Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface
$container Neomerx\JsonApi\Contracts\Schema\ContainerInterface

getIncludeRelationships() public method

public getIncludeRelationships ( $path, $type )

getParameters() public method

public getParameters ( )

hasExactPathMatch() protected method

If path has exact match with one of the 'include' paths.
protected hasExactPathMatch ( array $paths, string $path ) : boolean
$paths array
$path string
return boolean

hasMatchWithIncludedPaths() protected method

If path matches one of the included paths.
protected hasMatchWithIncludedPaths ( array $paths, string $path ) : boolean
$paths array
$path string
return boolean

hasSomeFields() public method

public hasSomeFields ( $type )

isPathIncluded() public method

public isPathIncluded ( $path, $type )