/** * 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); }
/** * {@inheritdoc} */ public function remove() { return $this->node->remove(); }