PHP Class Google\Cloud\BigQuery\Dataset

显示文件 Open project: GoogleCloudPlatform/gcloud-php

Public Methods

Method Description
__construct ( Google\Cloud\BigQuery\Connection\ConnectionInterface $connection, string $id, string $projectId, array $info = [] )
createTable ( $id, array $options = [] ) : Google\Cloud\BigQuery\Table Creates a table.
delete ( array $options = [] ) Delete the dataset.
exists ( ) : boolean Check whether or not the dataset exists.
id ( ) : string Retrieves the dataset's ID.
identity ( ) : array Retrieves the dataset's identity.
info ( array $options = [] ) : array Retrieves the dataset's details. If no dataset data is cached a network request will be made to retrieve it.
reload ( array $options = [] ) : array Triggers a network request to reload the dataset's details.
table ( string $id ) : Dataset Lazily instantiates a table. There are no network requests made at this point. To see the operations that can be performed on a dataset please see {@see Google\Cloud\BigQuery\Table}.
tables ( array $options = [] ) : Generator Fetches tables in the dataset.
update ( array $metadata, array $options = [] ) Update the dataset.

Method Details

__construct() public method

public __construct ( Google\Cloud\BigQuery\Connection\ConnectionInterface $connection, string $id, string $projectId, array $info = [] )
$connection Google\Cloud\BigQuery\Connection\ConnectionInterface Represents a connection to BigQuery.
$id string The dataset's ID.
$projectId string The project's ID.
$info array [optional] The dataset's metadata.

createTable() public method

Example: $table = $dataset->createTable('aTable');
See also: https://cloud.google.com/bigquery/docs/reference/v2/tables/insert Tables insert API documentation.
public createTable ( $id, array $options = [] ) : Google\Cloud\BigQuery\Table
$options array [optional] { Configuration options. @type array $metadata The available options for metadata are outlined at the [Table Resource API docs](https://cloud.google.com/bigquery/docs/reference/v2/tables#resource) }
return Google\Cloud\BigQuery\Table

delete() public method

Example: $dataset->delete();
See also: https://cloud.google.com/bigquery/docs/reference/v2/datasets/delete Datasets delete API documentation.
public delete ( array $options = [] )
$options array [optional] { Configuration options. @type bool $deleteContents If true, delete all the tables in the dataset. If false and the dataset contains tables, the request will fail. **Defaults to** `false`. }

exists() public method

Example: echo $dataset->exists();
public exists ( ) : boolean
return boolean

id() public method

Example: echo $dataset->id();
public id ( ) : string
return string

identity() public method

An identity provides a description of resource that is nested in nature. Example: echo $dataset->identity()['projectId'];
public identity ( ) : array
return array

info() public method

Example: $info = $dataset->info(); echo $info['friendlyName'];
See also: https://cloud.google.com/bigquery/docs/reference/v2/datasets#resource Datasets resource documentation.
public info ( array $options = [] ) : array
$options array [optional] Configuration options.
return array

reload() public method

Example: $dataset->reload(); $info = $dataset->info(); echo $info['friendlyName'];
See also: https://cloud.google.com/bigquery/docs/reference/v2/datasets/get Datasets get API documentation.
public reload ( array $options = [] ) : array
$options array [optional] Configuration options.
return array

table() public method

Example: $table = $dataset->table('myTableId');
public table ( string $id ) : Dataset
$id string The id of the table to request.
return Dataset

tables() public method

Example: $tables = $dataset->tables(); foreach ($tables as $table) { echo $table->id() . PHP_EOL; }
See also: https://cloud.google.com/bigquery/docs/reference/v2/tables/list Tables list API documentation.
public tables ( array $options = [] ) : Generator
$options array [optional] { Configuration options. @type int $maxResults Maximum number of results to return. }
return Generator

update() public method

Example: $dataset->update([ 'friendlyName' => 'A fanciful dataset.' ]);
See also: https://cloud.google.com/bigquery/docs/reference/v2/datasets/patch Datasets patch API documentation.
public update ( array $metadata, array $options = [] )
$metadata array The available options for metadata are outlined at the [Dataset Resource API docs](https://cloud.google.com/bigquery/docs/reference/v2/datasets#resource)
$options array [optional] Configuration options.