Doctrine\ODM\PHPCR\Tools\Console\Command\RegisterSystemNodeTypesCommand::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var $session \PHPCR\SessionInterface */
        $session = $this->getHelper('phpcr')->getSession();
        $registrator = new NodeTypeRegistrator();
        try {
            $registrator->registerNodeTypes($session);
        } catch (\Exception $e) {
            $output->writeln('<error>' . $e->getMessage() . '</error>');
            return 1;
        }
        $output->write(PHP_EOL . sprintf('Successfully registered system node types.') . PHP_EOL);
        return 0;
    }

Usage Example

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if (class_exists('Doctrine\\ODM\\PHPCR\\Tools\\Console\\Command\\RegisterSystemNodeTypesCommand')) {
         DoctrineCommandHelper::setApplicationPHPCRSession($this->getApplication(), $input->getOption('session'));
         $command = new RegisterSystemNodeTypesCommand();
         $command->setApplication($this->getApplication());
         $command->execute($input, $output);
     }
     $initializerManager = $this->getContainer()->get('doctrine_phpcr.initializer_manager');
     $initializerManager->setLoggingClosure(function ($message) use($output) {
         $output->writeln($message);
     });
     $initializerManager->initialize();
 }
All Usage Examples Of Doctrine\ODM\PHPCR\Tools\Console\Command\RegisterSystemNodeTypesCommand::execute
RegisterSystemNodeTypesCommand