connection->getQueryBuilder(); $query->select(['principaluri', 'uri']) ->from('calendarsubscriptions'); $stmt = $query->execute(); $count = 0; while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { $args = [ 'principaluri' => $row['principaluri'], 'uri' => $row['uri'], ]; if (!$this->jobList->has(RefreshWebcalJob::class, $args)) { $this->jobList->add(RefreshWebcalJob::class, $args); $count++; } } $output->info("Added $count background jobs to update webcal calendars"); } }