src/Sulu/Bundle/PageBundle/Search/Metadata/StructureProvider.php
public function getMetadataForObject($object)
    {
        if (!$object instanceof StructureBehavior) {
            return;
        }

        $documentMetadata = $this->metadataFactory->getMetadataForClass(get_class($object));
        $structure = $this->structureFactory->getStructureMetadata(
            $documentMetadata->getAlias(),
            $object->getStructureType()
        );

        return $this->getMetadata($documentMetadata, $structure);
    }
public function getMetadataForObject($object)
    {
        if (!$object instanceof StructureBehavior) {
            return;
        }

        $documentMetadata = $this->metadataFactory->getMetadataForClass(get_class($object));
        $structure = $this->structureFactory->getStructureMetadata(
            $documentMetadata->getAlias(),
            $object->getStructureType()
        );

        return $this->getMetadata($documentMetadata, $structure);
    }
public function getMetadataForObject ( $ object ) { if ( ! $ object instanceof StructureBehavior ) { return ; } $ documentMetadata = $ this -> metadataFactory -> getMetadataForClass ( get_class ( $ object ) ) ; $ structure = $ this -> structureFactory -> getStructureMetadata ( $ documentMetadata -> getAlias ( ) , $ object -> getStructureType ( ) ) ; return $ this -> getMetadata ( $ documentMetadata , $ structure ) ; }
loads metadata for a given class if its derived from StructureInterface.

@param object $object

@return IndexMetadataInterface|null
loads metadata for a given class if its derived from StructureInterface .