/** * 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(); }
/** * Structures are updated according to their xml definition. * * @param bool $up Indicates that this is up or down */ private function iterateStructures($up) { $properties = []; // find templates containing date 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->findDateProperties($structureMetadata, $properties); return !empty($properties[$structureName]) || !empty($blockProperties[$structureName]); }); foreach ($structureMetadatas as $structureMetadata) { $this->iterateStructureNodes($structureMetadata, $properties[$structureMetadata->getName()], $up); } $this->session->save(); }