src/Sulu/Component/Content/Document/Subscriber/StructureSubscriber.php
private function getStructure($document, $structureType, $rehydrate)
    {
        if ($structureType) {
            return $this->createStructure($document);
        }

        if (!$rehydrate && $document->getStructure()) {
            return $document->getStructure();
        }

        return new Structure();
    }
private function getStructure($document, $structureType, $rehydrate)
    {
        if ($structureType) {
            return $this->createStructure($document);
        }

        if (!$rehydrate && $document->getStructure()) {
            return $document->getStructure();
        }

        return new Structure();
    }
private function getStructure ( $ document , $ structureType , $ rehydrate ) { if ( $ structureType ) { return $ this -> createStructure ( $ document ) ; } if ( ! $ rehydrate && $ document -> getStructure ( ) ) { return $ document -> getStructure ( ) ; } return new Structure ( ) ; }
Return the a structure for the document.

- If the Structure already exists on the document, use that.
- If the Structure type is given, then create a ManagedStructure - this
means that the structure is already persisted on the node and it has data.
- If none of the above applies then create a new, empty, Structure.

@param object $document
@param string $structureType
@param bool $rehydrate

@return StructureInterface
Return the a structure for the document .