Sulu\Component\Content\Metadata\Factory\StructureMetadataFactoryInterface::getStructures PHP Method

getStructures() public method

Return all structures of the given type.
public getStructures ( $type ) : StructureMetadata[]
return Sulu\Component\Content\Metadata\StructureMetadata[]
    public function getStructures($type);

Usage Example

コード例 #1
0
ファイル: Version201511240844.php プロジェクト: ollietb/sulu
 /**
  * Structures are updated according to their xml definition.
  *
  * @param bool $addScheme Adds the scheme to URLs if true, removes the scheme otherwise
  */
 private function iterateStructures($addScheme)
 {
     $properties = [];
     // find templates containing URL fields
     $structureMetadatas = array_merge($this->structureMetadataFactory->getStructures('page'), $this->structureMetadataFactory->getStructures('snippet'));
     $structureMetadatas = array_filter($structureMetadatas, function (StructureMetadata $structureMetadata) use(&$properties) {
         $structureName = $structureMetadata->getName();
         $this->findUrlProperties($structureMetadata, $properties);
         return !empty($properties[$structureName]) || !empty($blockProperties[$structureName]);
     });
     foreach ($structureMetadatas as $structureMetadata) {
         $this->iterateStructureNodes($structureMetadata, $properties[$structureMetadata->getName()], $addScheme);
     }
     $this->documentManager->flush();
 }
All Usage Examples Of Sulu\Component\Content\Metadata\Factory\StructureMetadataFactoryInterface::getStructures