Google\Cloud\BigQuery\BigQueryClient::jobs PHP Method

jobs() public method

Example: Get all jobs with the state of 'done' $jobs = $bigQuery->jobs([ 'stateFilter' => 'done' ]); foreach ($jobs as $job) { echo $job->id() . PHP_EOL; }
See also: https://cloud.google.com/bigquery/docs/reference/v2/jobs/list Jobs list API documentation.
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`. }
return 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']);
    }