Knp\Bundle\KnpBundlesBundle\Updater\Updater::updateBundlesData PHP Метод

updateBundlesData() публичный Метод

public updateBundlesData ( )
    public function updateBundlesData()
    {
        $this->output->writeln(sprintf('[%s] Will now update commits, files and tags', date('d-m-y H:i:s')));
        $unitOfWork = $this->em->getUnitOfWork();
        $page = 1;
        $pager = $this->paginateExistingBundles($page);
        do {
            // Now update bundles with more precise GitHub data
            /** @var $bundle Bundle */
            foreach ($pager->getCurrentPageResults() as $bundle) {
                if (UnitOfWork::STATE_MANAGED !== $unitOfWork->getEntityState($bundle)) {
                    continue;
                }
                $this->updateRepo($bundle);
            }
            ++$page;
        } while ($pager->hasNextPage() && $pager->setCurrentPage($page, false, true));
    }

Usage Example

Пример #1
0
 /**
  * {@inheritdoc}
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $gitRepoDir = $this->getContainer()->getParameter('knp_bundles.bundles_dir');
     $gitBin = $this->getContainer()->getParameter('knp_bundles.git_bin');
     $em = $this->getContainer()->get('knp_bundles.entity_manager');
     $updater = new Updater($em, $gitRepoDir, $gitBin, $output);
     $updater->setUp();
     $updater->updateBundlesData();
     $em->flush();
 }
All Usage Examples Of Knp\Bundle\KnpBundlesBundle\Updater\Updater::updateBundlesData