generic_view
class generic_view extends bigquery_base_table_service
Constants
| DATASET |
|
| TABLE |
|
| IDNUMBER |
|
| TYPE_BOOL |
|
| TYPE_BOOLEAN |
|
| TYPE_INT64 |
|
| TYPE_INTEGER |
|
| TYPE_FLOAT64 |
|
| TYPE_FLOAT |
|
| TYPE_NUMERIC |
|
| TYPE_BIGNUMERIC |
|
| TYPE_STRING |
|
| TYPE_BYTES |
|
| TYPE_DATE |
|
| TYPE_DATETIME |
|
| TYPE_TIME |
|
| TYPE_TIMESTAMP |
|
| TYPE_ARRAY |
|
| TYPE_STRUCT |
|
| TYPE_RECORD |
|
| TYPE_GEOGRAPHY |
|
| TYPE_JSON |
|
| MODE_NULLABLE |
|
| MODE_REQUIRED |
|
| MODE_REPEATED |
|
Properties
| protected string | $table | from bigquery_base_service | |
| protected string | $name | from bigquery_base_service | |
| static protected | $idnumber | from bigquery_base_table_service | |
| static protected array | $instances | from bigquery_base_table_service |
Methods
Get the name of the view.
Retrieves the dataset name associated with the class.
Retrieves the ID number associated with the object.
Get the table name associated with the class.
Indicates whether foreign keys are present or enabled.
Retrieves the header information associated with the current table.
Retrieves and returns the fields associated with the current table.
Determines if the current operation can be executed.
Retrieves and constructs a set of options including schema, primary key, and foreign key information.
Updates and stores the row count of a specific database table in the configuration.
Executes the data preparation process for Google BigQuery, including table validation, data generation, and job creation, while handling errors and cleaning up temporary files.
Retrieves and returns the header of a table as an array of column names.
Retrieves and returns the fields and their metadata for a given database table.
Determines and returns the corresponding field type based on the provided type.
Generates and retrieves data from the database table associated with this instance.
Saves the provided data to a CSV file with an optional header.
Saves the provided data to a JSON file.
Generates a filename based on the class name, current timestamp, and given extension.
Retrieves the full file path for a given file extension.
Constructor method to initialize the object with table, name, and idnumber.
Get an instance of the class for a specific table.
Details
at line 32
string
get_name()
Get the name of the view.
If the name is empty or '0', it returns a default string from the language file. Otherwise, it returns the actual name.
in
bigquery_base_table_service at line 61
static string
get_dataset()
Retrieves the dataset name associated with the class.
in
bigquery_base_service at line 117
string
get_table()
Retrieves the table name associated with the object.
If the table name is not set or is empty, it returns a default static table name.
in
bigquery_base_service at line 128
string
get_idnumber()
Retrieves the ID number associated with the object.
If the ID number is not set, it returns a default static ID number.
at line 42
bool|string
primarykey()
Get the table name associated with the class.
in
bigquery_base_service at line 148
bool
foreignkeys()
Indicates whether foreign keys are present or enabled.
in
bigquery_base_service at line 158
array
get_header()
Retrieves the header information associated with the current table.
in
bigquery_base_table_service at line 71
array
get_fields()
Retrieves and returns the fields associated with the current table.
in
bigquery_base_service at line 178
static bool
can_execute()
Determines if the current operation can be executed.
in
bigquery_base_service at line 188
array
get_options()
Retrieves and constructs a set of options including schema, primary key, and foreign key information.
in
bigquery_base_service at line 214
void
set_count_table_row()
Updates and stores the row count of a specific database table in the configuration.
This method retrieves the row count of a given table from the database and saves it into a configuration entry. If there are existing table row counts stored, they are maintained and updated with the new row count for the specific table.
in
bigquery_base_service at line 237
bool|null
execute()
Executes the data preparation process for Google BigQuery, including table validation, data generation, and job creation, while handling errors and cleaning up temporary files.
in
bigquery_base_service at line 304
static array
get_header_by_table(string $tablename)
Retrieves and returns the header of a table as an array of column names.
in
bigquery_base_service at line 326
static array
get_fields_by_table(string $tablename)
Retrieves and returns the fields and their metadata for a given database table.
in
bigquery_base_service at line 356
static string
get_field_type(string $type)
Determines and returns the corresponding field type based on the provided type.
in
bigquery_base_service at line 370
protected array
get_schema()
Retrieves the schema of the current context.
in
bigquery_base_service at line 384
protected array
generate_data()
Generates and retrieves data from the database table associated with this instance.
in
bigquery_base_service at line 412
static protected string|null
save_to_csv(array $data, array $header)
Saves the provided data to a CSV file with an optional header.
in
bigquery_base_service at line 465
static protected string
save_to_json(array $data)
Saves the provided data to a JSON file.
Each array entry will be written as a separate JSON object in a new line, following the newline-delimited JSON (NDJSON) format, often used for compatibility with tools like Google BigQuery.
in
bigquery_base_service at line 491
static protected string
get_filename(string $extension)
Generates a filename based on the class name, current timestamp, and given extension.
in
bigquery_base_service at line 505
static protected string
get_filepath(string $extension)
Retrieves the full file path for a given file extension.
in
bigquery_base_table_service at line 33
__construct(string $table = '', string $name = '', string $idnumber = '')
Constructor method to initialize the object with table, name, and idnumber.
in
bigquery_base_table_service at line 47
static bigquery_base_table_service
getInstance(string $table, string|null $name = null, string|null $idnumber = null)
Get an instance of the class for a specific table.