Sulu\Component\Util\SuluNodeHelper::getStructureTypeForNode PHP Method

getStructureTypeForNode() public method

Return the structure type for the given node.
public getStructureTypeForNode ( PHPCR\NodeInterface $node ) : string
$node PHPCR\NodeInterface
return string
    public function getStructureTypeForNode(NodeInterface $node)
    {
        $mixinTypes = $node->getPropertyValueWithDefault('jcr:mixinTypes', []);
        if (in_array('sulu:' . Structure::TYPE_PAGE, $mixinTypes)) {
            return Structure::TYPE_PAGE;
        }
        if (in_array('sulu:' . Structure::TYPE_SNIPPET, $mixinTypes)) {
            return Structure::TYPE_SNIPPET;
        }
        return;
    }