This class provides the user interface of the Data Designer tool. The form can be used to create or alter table
and index designs. Tables and indexes can be created from their design by using the appropriate buttons.
Tables and their indexes can be reverse engineered from the database. This process can be started from scratch
or applied to an existing table design. For the last situation users can use the reconcile button. This will
bring the table and index design in the same state as their physical database counterpart.
Methods
WPDA_Design_Table_Form constructor.
__construct()
Show Data Designer form
show()
Generate alter table script
alter_table()
Alter table script is written to $this->create_table_statement.
Create indexes from design
create_index()
Perform create table statement
create_table()
Perform alter table
do_alter_table()
Call $this->alter_table() to generate alter table script and process result taken
from $this->create_table_statement.
Drop a specific index from database
drop_index(string $index_name)
Parameters
$index_name
string
Name of index to be dropped
Drop all indexes from database
drop_indexes()
Drop database table
drop_table()
Does not drop WordPress tables.
Alter column format
alter_table_column(object $design_column, string $keyword)
Parameters
$design_column
object
Column definition
$keyword
string
ADD or MODIFY
Check if table exists in our database
does_table_exist()
Get table and index structure from design
get_table_structure()
Properties
Action argument
$action : string | null
Saved value of action2 argument used for later equations
$action2 : string | null
Action2 argument
$action2_posted : string | null
Alter table statement for the designed table at startup. Updates in the user interface are not immediately
reflected. User needs to reload/save the page.
$alter_table_statement : array
Indicates where a alter table statement succeeded
$alter_table_succeeded : boolean | null
Argument which can be used to jump back to another page than the default table list for table designs.
$caller : string
Indicates where a create index statement failed
$create_index_failed : boolean | null
Create index statement(s) for the designed index(es) at startup. Updates in the user interface are not
immediately reflected. User needs to reload/save the page.
$create_index_statement : string
Create table statement for the designed table at startup. Updates in the user interface are not immediately
reflected. User needs to reload/save the page.
$create_table_statement : string
Indicates where a create table statement succeeded
$create_table_succeeded : boolean | null
Holds all available databases
$database : array
Indicates whether columns or indexes were deleted in the actual design. If true checkbox "Show deleted
columns and indexes" will be accessible.
$deleted_columns_and_indexes : boolean
Allowed values are: Basic or Advanced. Can be supplied as an argument. Taken from WPDA class f no argument
is provided.
$design_mode : string | null
$fulltext_support
$fulltext_support
Indicates whether the design has indexes.
$indexes_found : boolean
Indicates whether the table is a WordPress table
$is_wp_table : boolean | null
Object of type WPDA_Design_Table_Model used for data manipulation
$model : object | null
Page name (wpda_designer)
$page : string | null
Holds the structure of the real physical database indexes
$real_indexes : array | null
Holds the structure of the real physical database table
$real_table : array | null
Indicates whether the structure of the database table equals the table design
$table_altered : boolean | null
Named array holding table columns
$table_columns : array | null
Indicates whether the table was found in the database
$table_exists : boolean | null
Indicates whether indexes were updated in the actual design.
$updated_indexes : boolean
Schema name
$wpda_schema_name : string | null
Table design (taken from WPDA_Design_Table_Model)
$wpda_table_design : array | null
Table name
$wpda_table_name : string | null
Last error from wpdb
$wpdb_error : string | null
Constants
NEW_LINE
NEW_LINE = '<br/>'