private function updateNodes($classname)
    {
        $this->output->writeln(sprintf('<info>Updating nested data for %s.</info>', $classname));

        if (true === $this->skipNodesUpdate) {
            $this->output->writeln(' - <comment>Skipped</comment> (option --skip-nodes-update set)');
            return $this;
        }

        $sites = $this->em->getRepository('BackBee\Site\Site')->findAll();
        if (0 === count($sites)) {
            $this->output->writeln(' - None site found - <comment>Skipped</comment>');
            return $this;
        }

        $progress = $this->getHelperSet()->get('progress');
        $progress->start($this->output, $this->countNodes($classname));

        $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=0');
        foreach ($sites as $site) {
            foreach ($this->getPageRoot($site, $classname) as $root_uid) {
                $this->updateTreeNatively($root_uid, $classname);
            }
        }
        $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=1');

        $progress->finish();

        return $this;
    }
private function updateNodes($classname)
    {
        $this->output->writeln(sprintf('<info>Updating nested data for %s.</info>', $classname));

        if (true === $this->skipNodesUpdate) {
            $this->output->writeln(' - <comment>Skipped</comment> (option --skip-nodes-update set)');
            return $this;
        }

        $sites = $this->em->getRepository('BackBee\Site\Site')->findAll();
        if (0 === count($sites)) {
            $this->output->writeln(' - None site found - <comment>Skipped</comment>');
            return $this;
        }

        $progress = $this->getHelperSet()->get('progress');
        $progress->start($this->output, $this->countNodes($classname));

        $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=0');
        foreach ($sites as $site) {
            foreach ($this->getPageRoot($site, $classname) as $root_uid) {
                $this->updateTreeNatively($root_uid, $classname);
            }
        }
        $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=1');

        $progress->finish();

        return $this;
    }
private function updateNodes ( $ classname ) { $ this -> output -> writeln ( sprintf ( '<info>Updating nested data for %s.</info>' , $ classname ) ) ; if ( true === $ this -> skipNodesUpdate ) { $ this -> output -> writeln ( ' - <comment>Skipped</comment> (option --skip-nodes-update set)' ) ; return $ this ; } $ sites = $ this -> em -> getRepository ( 'BackBee\Site\Site' ) -> findAll ( ) ; if ( 0 === count ( $ sites ) ) { $ this -> output -> writeln ( ' - None site found - <comment>Skipped</comment>' ) ; return $ this ; } $ progress = $ this -> getHelperSet ( ) -> get ( 'progress' ) ; $ progress -> start ( $ this -> output , $ this -> countNodes ( $ classname ) ) ; $ this -> em -> getConnection ( ) -> executeUpdate ( 'SET FOREIGN_KEY_CHECKS=0' ) ; foreach ( $ sites as $ site ) { foreach ( $ this -> getPageRoot ( $ site , $ classname ) as $ root_uid ) { $ this -> updateTreeNatively ( $ root_uid , $ classname ) ; } } $ this -> em -> getConnection ( ) -> executeUpdate ( 'SET FOREIGN_KEY_CHECKS=1' ) ; $ progress -> finish ( ) ; return $ this ; }
Updates nested data from existing pages

@param  string       $classname

@return \BackBee\Console\Command\UpgradeToPageSectionCommand
Updates nested data from existing pages