Esempio n. 1
0
 /**
  * Cleanup specific node and his children.
  *
  * @param NodeInterface $node
  * @param string        $rootPath
  * @param bool          $dryRun
  */
 private function cleanup(OutputInterface $output, NodeInterface $node, $rootPath, $dryRun)
 {
     foreach ($node->getNodes() as $childNode) {
         $this->cleanup($output, $childNode, $rootPath, $dryRun);
     }
     $path = ltrim(str_replace($rootPath, '', $node->getPath()), '/');
     if (!$node->getPropertyValueWithDefault('sulu:history', false)) {
         $output->writeln('<info>Processing aborted: </info>/' . $path . ' <comment>(no history url)</comment>');
         return;
     }
     if ($dryRun === false) {
         $node->remove();
     }
     $output->writeln('<info>Processing: </info>/' . $path);
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function remove()
 {
     return $this->node->remove();
 }