Loading lib/Command/MigrateWebmailAddressbooks.php +6 −2 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ class MigrateWebmailAddressbooks extends Command { null, InputOption::VALUE_OPTIONAL, 'Limit of users to migrate', null 0 ) ->addOption( 'offset', Loading Loading @@ -88,7 +88,11 @@ class MigrateWebmailAddressbooks extends Command { $emails[] = $email; } if ($limit === 0) { $this->commandOutput->writeln('Migrating all users starting at ' . $offset); } else { $this->commandOutput->writeln('Migrating ' . $limit . ' users starting at ' . $offset); } $users = $this->webmailMapper->getUsers($limit, $offset, $emails); if (empty($users)) { return; Loading lib/Db/WebmailMapper.php +2 −2 Original line number Diff line number Diff line Loading @@ -52,12 +52,12 @@ class WebmailMapper { } public function getUsers(int $limit, int $offset = 0, array $emails = []) : array { public function getUsers(int $limit = 0, int $offset = 0, array $emails = []) : array { $qb = $this->conn->createQueryBuilder(); $qb->select('rl_email, id_user') ->from(self::USERS_TABLE, 'u') ->setFirstResult($offset); if ($limit) { if ($limit > 0) { $qb->setMaxResults($limit); } if (!empty($emails)) { Loading Loading
lib/Command/MigrateWebmailAddressbooks.php +6 −2 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ class MigrateWebmailAddressbooks extends Command { null, InputOption::VALUE_OPTIONAL, 'Limit of users to migrate', null 0 ) ->addOption( 'offset', Loading Loading @@ -88,7 +88,11 @@ class MigrateWebmailAddressbooks extends Command { $emails[] = $email; } if ($limit === 0) { $this->commandOutput->writeln('Migrating all users starting at ' . $offset); } else { $this->commandOutput->writeln('Migrating ' . $limit . ' users starting at ' . $offset); } $users = $this->webmailMapper->getUsers($limit, $offset, $emails); if (empty($users)) { return; Loading
lib/Db/WebmailMapper.php +2 −2 Original line number Diff line number Diff line Loading @@ -52,12 +52,12 @@ class WebmailMapper { } public function getUsers(int $limit, int $offset = 0, array $emails = []) : array { public function getUsers(int $limit = 0, int $offset = 0, array $emails = []) : array { $qb = $this->conn->createQueryBuilder(); $qb->select('rl_email, id_user') ->from(self::USERS_TABLE, 'u') ->setFirstResult($offset); if ($limit) { if ($limit > 0) { $qb->setMaxResults($limit); } if (!empty($emails)) { Loading