/**
* Creates a table.
*
* Example:
* ```
* $table = $dataset->createTable('aTable');
* ```
*
* @see https://cloud.google.com/bigquery/docs/reference/v2/tables/insert Tables insert API documentation.
*
* @param array $options [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 Table
*/
public function createTable($id, array $options = [])
{
if (isset($options['metadata'])) {
$options += $options['metadata'];
unset($options['metadata']);
}
$response = $this->connection->insertTable(['projectId' => $this->identity['projectId'], 'datasetId' => $this->identity['datasetId'], 'tableReference' => $this->identity + ['tableId' => $id]] + $options);
return new Table($this->connection, $id, $this->identity['datasetId'], $this->identity['projectId'], $response);
}