Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 79e3fd53 authored by Akhil's avatar Akhil
Browse files

Fix default value of limit

parent e5b44d29
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ class MigrateWebmailAddressbooks extends Command {
				null,
				InputOption::VALUE_OPTIONAL,
				'Limit of users to migrate',
				null
				0
			)
			->addOption(
				'offset',
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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)) {