public jobs ( array $options = [] ) : Generator |
||
$options | array | [optional] { Configuration options. @type bool $allUsers Whether to display jobs owned by all users in the project. **Defaults to** `false`. @type int $maxResults Maximum number of results to return. @type string $stateFilter Filter for job state. Maybe be either `done`, `pending`, or `running`. } |
Результат | Generator |
public function jobs(array $options = [])
{
$options['pageToken'] = null;
do {
$response = $this->connection->listJobs($options + ['projectId' => $this->projectId]);
if (!isset($response['jobs'])) {
return;
}
foreach ($response['jobs'] as $job) {
(yield new Job($this->connection, $job['jobReference']['jobId'], $this->projectId, $job, $this->mapper));
}
$options['pageToken'] = isset($response['nextPageToken']) ? $response['nextPageToken'] : null;
} while ($options['pageToken']);
}