PHP Class Google\Cloud\BigQuery\InsertResponse

This class should be not instantiated directly, but as a result of calling {@see \Google\Cloud\BigQuery\Table::insertRow()} or {@see \Google\Cloud\BigQuery\Table::insertRows()}.
Mostra file Open project: GoogleCloudPlatform/gcloud-php Class Usage Examples

Public Methods

Method Description
__construct ( array $info, array $rows )
failedRows ( ) : array Returns the rows which failed to insert along with their associated errors and index in the original data set.
info ( ) : array Retrieves the full API response.
isSuccessful ( ) : boolean Determines if the request was successful.

Method Details

__construct() public method

public __construct ( array $info, array $rows )
$info array The API response.
$rows array The rows provided in the original request.

failedRows() public method

Example: $rows = $insertResponse->failedRows(); foreach ($rows as $row) { print_r($row['rowData']) . PHP_EOL; foreach ($row['errors'] as $error) { echo $error['reason'] . ': ' . $error['message'] . PHP_EOL; } }
See also: https://cloud.google.com/bigquery/docs/reference/v2/tabledata/insertAll#response Tabledata insertAll API response documentation.
public failedRows ( ) : array
return array

info() public method

Example: $info = $insertResponse->info(); print_r($info['insertErrors']);
See also: https://cloud.google.com/bigquery/docs/reference/v2/tabledata/insertAll#response Tabledata insertAll API response documentation.
public info ( ) : array
return array

isSuccessful() public method

Example: if (!$insertResponse->isSuccessful()) { print_r($insertResponse->failedRows()); }
public isSuccessful ( ) : boolean
return boolean