Neomerx\JsonApi\Encoder\Parser\ParserManager::isShouldParseRelationships PHP Метод

isShouldParseRelationships() публичный Метод

public isShouldParseRelationships ( Neomerx\JsonApi\Contracts\Encoder\Stack\StackReadOnlyInterface $stack )
$stack Neomerx\JsonApi\Contracts\Encoder\Stack\StackReadOnlyInterface
    public function isShouldParseRelationships(StackReadOnlyInterface $stack)
    {
        if ($stack->count() < 2) {
            // top level, no resources ware started to parse yet
            $shouldContinue = true;
        } else {
            // on the way to included paths
            $currentPath = $stack->end()->getPath();
            $currentRootType = $stack->root()->getResource()->getType();
            $shouldContinue = $this->parameterAnalyzer->isPathIncluded($currentPath, $currentRootType);
        }
        return $shouldContinue;
    }