jobList = $jobList; $this->mailboxMapper = $mailboxMapper; } protected function configure(): void { $this->setName('mail:tags:migration-jobs'); $this->setDescription('Creates a background job entry in the cron table for every user to migrate important labels to IMAP'); } protected function execute(InputInterface $input, OutputInterface $output): int { $count = 0; foreach ($this->mailboxMapper->findAllIds() as $mailboxId) { $this->jobList->add(MigrateImportantJob::class, ['mailboxId' => $mailboxId]); $count++; } $output->writeln("Created entries for $count mailboxes in Cron Jobs table."); return 0; } }