Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Comand to build (or rebuild) the search index.
- */
- class PublishCommand extends ContainerAwareCommand
- {
- /**
- * {@inheritdoc}
- */
- public function configure()
- {
- $this->setName('wacg:publish');
- }
- /**
- * {@inheritdoc}
- */
- public function execute(InputInterface $input, OutputInterface $output)
- {
- $container = $this->getContainer();
- /** @var \Sulu\Component\PHPCR\SessionManager\SessionManager $session */
- $sessionManager = $container->get('sulu.phpcr.session');
- $session = $sessionManager->getSession();
- /** @var \Sulu\Component\DocumentManager\DocumentManager $dm */
- $this->dm = $container->get('sulu_document_manager.document_manager');
- $this->output = $output;
- $durchblick = $this->dm->find('/cmf/durchblick_digital/contents/durchblick');
- $releases = $durchblick->getChildren();
- /** @var PageDocument $release */
- foreach ($releases as $release) {
- $release->setWorkflowStage(WorkflowStage::PUBLISHED);
- $this->dm->persist($release, $release->getLocale());
- }
- $this->output->writeln('Performing operations...');
- $this->dm->flush();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement