Class WPDP_List_Columns
Taken from WPDA_List_Columns. This class adds extra functionality for Data Projects. Column headers defined in 'Manage Table Options' are taken into account in this class.
author | Peter Schulz |
---|---|
since | 2.0.0 |
package | WPDataProjects\Data_Dictionary |
inherited_from | \WPDataAccess\Data_Dictionary\WPDA_List_Columns |
__construct(string $schema_name, string $table_name, string $label_type, string $setname = 'default'
)
inherited_from | \WPDataAccess\Data_Dictionary\WPDA_List_Columns::__construct() |
---|
string
Database schema name
string
Database table name
string
Label type
string
Options set name
__construct(string $schema_name, string $table_name)
since | 1.0.0 |
---|
string
Database schema name.
string
Database table name.
get_auto_increment_column_name() : boolean | string
since | 1.0.0 |
---|
boolean
string
Name of auto increment column or false if no auto increment column existsget_column_data_type($column_name) : string | null
since | 2.7.2 |
---|
Database column name
string
null
get_column_label(string $column_name) : string
Take column label from structure or default if not found (call parent method)
inherited_from | \WPDataAccess\Data_Dictionary\WPDA_List_Columns::get_column_label() |
---|
string
Database column name
string
Column labelget_column_label(string $column_name) : string
Returns the label of a column according to a pre defined format. Call must contain column name. Column must be in $this->table_name.
since | 1.0.0 |
---|
string
Column name as defined in the data dictionary.
string
Label for $column_name.get_column_type($column_name) : string | null
since | 2.7.2 |
---|
Database column name
string
null
get_default_column_label(string $column_name) : string
Returns the default label of a column according to a pre defined format. Call must contain column name. Column must be in $this->table_name.
since | 1.0.0 |
---|
string
Column name as defined in the data dictionary.
string
Default label for $column_name.get_setname() : string
string
get_table_alternative_keys()
get_table_column_headers() : array
since | 1.0.0 |
---|
array
get_table_columns() : array
since | 1.0.0 |
---|
array
Column of $this->table_name.get_table_primary_key() : array
since | 1.0.0 |
---|
array
Primary key columns of $this->table_name.is_primary_key_column(string $column_name) : boolean
since | 1.0.0 |
---|
string
Column name as defined in the data dictionary.
boolean
TRUE = column is part of primary key, FALSE = column is not part of primary key.get_table_unique_indexes()
set_table_column_headers()
Use headers if a structure is found for the given table. Otherwise call parent to use the default.
inherited_from | \WPDataAccess\Data_Dictionary\WPDA_List_Columns::set_table_column_headers() |
---|
set_table_column_headers()
For now column headers are defined equal to their names. If a column is part of the primary key, this is reflected in the column header.
since | 1.0.0 |
---|
set_table_columns()
Calls parent method to perform query and then sorts the result
inherited_from | \WPDataAccess\Data_Dictionary\WPDA_List_Columns::set_table_columns() |
---|
set_table_columns()
Column info is taken from the MySQL data dictionary. For each column in $this->table_name the following column info is stored:
Since MariaDB 10.2.7 and higher handles default values different than other DBMSs we have to take care of the quotes it places at the beginning and the end. This involves the implication that users cannot use default values that start and end with a single quote. Which seems common sense for me.
since | 1.0.0 |
---|
set_table_primary_key()
Primary key columns are taken from the MySQL data dictionary.
Newer versions of MariaDB no longer seem to support JOIN USING. Rewritten to old school join. MySQL supports both types of joins.
since | 1.0.0 |
---|
get_array_index(string $column_options, string $column_name) : integer
string
Array containing columns and their options
string
Database column name
integer
Column index$auto_increment_column_name : boolean | string
false
$label_type : \WPDataProjects\Data_Dictionary\label_type
$schema_name : string
$setname : string
'default'
$table_column_data_type : array
array()
$table_column_headers : array
array()
$table_column_type : array
array()
$table_columns : array
array()
$table_name : string
$table_primary_key : array
array()
$table_primary_key_check : array
array()
$table_settings : null | Object
null
$wpdadb : null
null