Sulu\Component\Content\Compat\StructureManagerInterface::wrapStructure PHP Méthode

wrapStructure() public méthode

Wrap the given Structure with a legacy (bridge) structure.
public wrapStructure ( string $type, StructureMetadata $structure ) : Sulu\Component\Content\Compat\StructureInterface
$type string
$structure Sulu\Component\Content\Metadata\StructureMetadata
Résultat Sulu\Component\Content\Compat\StructureInterface
    public function wrapStructure($type, StructureMetadata $structure);

Usage Example

Exemple #1
0
 /**
  * Return a structure bridge corresponding to the given document.
  *
  * @param BasePageDocument $document
  *
  * @return PageBridge
  */
 protected function documentToStructure(BasePageDocument $document)
 {
     $structure = $this->inspector->getStructureMetadata($document);
     $documentAlias = $this->inspector->getMetadata($document)->getAlias();
     $structureBridge = $this->structureManager->wrapStructure($documentAlias, $structure);
     $structureBridge->setDocument($document);
     return $structureBridge;
 }
All Usage Examples Of Sulu\Component\Content\Compat\StructureManagerInterface::wrapStructure