1.39.4 (latest) 1.39.3 1.38.0 1.37.0 1.36.0 1.35.2 1.34.7 1.33.1 1.32.0 1.31.1 1.30.3 1.29.0 1.28.3 1.27.0 1.26.1 1.25.1 1.24.2 1.23.10 Reference documentation and code samples for the BigQuery Client class CopyJobConfiguration.

Represents a configuration for a copy job. For more information on the
available settings please see the
[Jobs configuration API documentation](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job).

Example:

```php
use Google\Cloud\BigQuery\BigQueryClient;

$bigQuery = new BigQueryClient();
$sourceTable = $bigQuery->dataset('my_dataset')
    ->table('my_source_table');
$destinationTable = $bigQuery->dataset('my_dataset')
    ->table('my_destination_table');

$copyJobConfig = $sourceTable->copy($destinationTable);
```

## Namespace

Google \\ Cloud \\ BigQuery

## Implements

[JobConfigurationInterface](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery/latest/JobConfigurationInterface.md.txt)

## Methods

### __construct

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `string` The project's ID. |
| `config` | `array` A set of configuration options for a job. |
| `location` | `string|null` The geographic location in which the job is executed. |

### createDisposition

Set whether the job is allowed to create new tables. Creation, truncation
and append actions occur as one atomic update upon job completion.

Example:

```php
$copyJobConfig->createDisposition('CREATE_NEVER');
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `createDisposition` | `string` The create disposition. Acceptable values include `"CREATED_IF_NEEDED"`, `"CREATE_NEVER"`. **Defaults to** `"CREATE_IF_NEEDED"`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `CopyJobConfiguration` |   |

### destinationEncryptionConfiguration

Sets the custom encryption configuration (e.g., Cloud KMS keys).

Example:

```php
$copyJobConfig->destinationEncryptionConfiguration([
    'kmsKeyName' => 'my_key'
]);
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `array` Custom encryption configuration. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `CopyJobConfiguration` |   |

### destinationTable

Sets the destination table.

Example:

```php
$table = $bigQuery->dataset('my_dataset')
    ->table('my_table');
$copyJobConfig->destinationTable($table);
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `destinationTable` | `Table` The destination table. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `CopyJobConfiguration` |   |

### sourceTable

Sets the source table to copy.

Example:

```php
$table = $bigQuery->dataset('my_dataset')
    ->table('source_table');
$copyJobConfig->sourceTable($table);
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `sourceTable` | `Table` The destination table. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `CopyJobConfiguration` |   |

### writeDisposition

Sets the action that occurs if the destination table already exists. Each
action is atomic and only occurs if BigQuery is able to complete the job
successfully. Creation, truncation and append actions occur as one atomic
update upon job completion.

Example:

```php
$copyJobConfig->writeDisposition('WRITE_TRUNCATE');
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `writeDisposition` | `string` The write disposition. Acceptable values include `"WRITE_TRUNCATE"`, `"WRITE_APPEND"`, `"WRITE_EMPTY"`. *Defaults to* \* `"WRITE_EMPTY"`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `CopyJobConfiguration` |   |