bigquery_sendcsv_service
class bigquery_sendcsv_service
Methods
Gets the name of the service.
Gets the header row for the CSV file based on the column mapping configuration.
Gets the list of fields with their names and types based on the column mapping configuration.
Gets the primary key for the table.
Gets the foreign keys for the table.
Generates and returns an array of options for configuring a BigQuery table.
Generates and returns an array of data rows mapped based on the column mapping configuration.
No description
Validates if the data types of the given data entries match the specified types.
Executes the upload process for a CSV file, including data validation, file preparation, and interaction with the BigQuery API. This method handles exceptions and ensures that the operation complies with the required configuration and logic.
Saves the given data array to a JSON file, where each element is written as a single JSON object per line.
Generates and retrieves the full file path for a given file extension.
Generates a unique filename based on the class name and current timestamp.
Saves the provided data to a CSV file with an optional header row.
Details
at line 32
static string
get_name()
Gets the name of the service.
at line 44
array
get_header(mixed $uploadcsvfile)
Gets the header row for the CSV file based on the column mapping configuration.
at line 61
array
get_fields(mixed $uploadcsvfile)
Gets the list of fields with their names and types based on the column mapping configuration.
at line 79
string
primarykey()
Gets the primary key for the table.
at line 89
string
foreignkeys()
Gets the foreign keys for the table.
at line 101
array
get_options(mixed $uploadcsvfile)
Generates and returns an array of options for configuring a BigQuery table.
at line 129
array
generate_data(mixed $uploadcsvfile)
Generates and returns an array of data rows mapped based on the column mapping configuration.
at line 152
static bool
can_execute()
No description
at line 166
bool
is_valid_data_type(array $data, mixed $uploadcsvfile)
Validates if the data types of the given data entries match the specified types.
at line 232
bool
execute(uploadcsvfile $uploadcsvfile)
Executes the upload process for a CSV file, including data validation, file preparation, and interaction with the BigQuery API. This method handles exceptions and ensures that the operation complies with the required configuration and logic.
at line 308
protected string
save_to_json(array $data)
Saves the given data array to a JSON file, where each element is written as a single JSON object per line.
at line 334
protected string
get_filepath(string $extension)
Generates and retrieves the full file path for a given file extension.
at line 353
static protected string
get_filename(string $extension)
Generates a unique filename based on the class name and current timestamp.
at line 370
protected string
save_to_csv(array $data, array $header)
Saves the provided data to a CSV file with an optional header row.