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

datasets() public method

Example: $datasets = $bigQuery->datasets(); foreach ($datasets as $dataset) { echo $dataset->id() . PHP_EOL; }
See also: https://cloud.google.com/bigquery/docs/reference/v2/datasets/list Datasets list API documentation.
public datasets ( array $options = [] ) : Generator
$options array [optional] { Configuration options. @type bool $all Whether to list all datasets, including hidden ones. @type int $maxResults Maximum number of results to return. }
return Generator
    public function datasets(array $options = [])
    {
        $options['pageToken'] = null;
        do {
            $response = $this->connection->listDatasets($options + ['projectId' => $this->projectId]);
            if (!isset($response['datasets'])) {
                return;
            }
            foreach ($response['datasets'] as $dataset) {
                (yield new Dataset($this->connection, $dataset['datasetReference']['datasetId'], $this->projectId, $dataset));
            }
            $options['pageToken'] = isset($response['nextPageToken']) ? $response['nextPageToken'] : null;
        } while ($options['pageToken']);
    }