private function paginateExistingBundles($page, $limit = 100)
{
$pager = new Pagerfanta(new DoctrineORMAdapter($this->em->getRepository('KnpBundlesBundle:Bundle')->queryAllSortedBy('updatedAt'), false));
$pager->setMaxPerPage($limit)->setCurrentPage($page, false, true);
if (1 === $page) {
$this->output->writeln(sprintf('[%s] Loaded <comment>%d</comment> bundles from the DB', date('d-m-y H:i:s'), $pager->getNbResults()));
}
return $pager;
}