Class WPDA_Design_Table_Form

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.

author Peter Schulz
since 1.1.0
package WPDataAccess\Design_Table

 Methods

WPDA_Design_Table_Form constructor.

__construct() 
since 1.1.0

Show Data Designer form

show() 
since 1.1.0

Generate alter table script

alter_table() 

Alter table script is written to $this->create_table_statement.

see \WPDataAccess\Design_Table\WPDA_Design_Table_Form::create_table_statement
since 2.0.14

Create indexes from design

create_index() 
since 2.0.14

Perform create table statement

create_table() 
since 1.1.0

Perform alter table

do_alter_table() 

Call $this->alter_table() to generate alter table script and process result taken from $this->create_table_statement.

see \WPDataAccess\Design_Table\WPDA_Design_Table_Form::alter_table()
see \WPDataAccess\Design_Table\WPDA_Design_Table_Form::create_table_statement
since 2.0.14

Drop a specific index from database

drop_index(string $index_name) 
since 2.0.14

Parameters

$index_name

string

Name of index to be dropped

Drop all indexes from database

drop_indexes() 
since 2.0.14

Drop database table

drop_table() 

Does not drop WordPress tables.

since 2.0.14

Alter column format

alter_table_column(object $design_column, string $keyword) 
since 2.0.14

Parameters

$design_column

object

Column definition

$keyword

string

ADD or MODIFY

Check if table exists in our database

does_table_exist() 
since 2.0.14

Get table and index structure from design

get_table_structure() 
since 2.0.14

 Properties

 

Action argument

$action : string | null

Default

null
 

Saved value of action2 argument used for later equations

$action2 : string | null

Default

null
 

Action2 argument

$action2_posted : string | null

Default

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

Default

array()
 

Indicates where a alter table statement succeeded

$alter_table_succeeded : boolean | null

Default

null
 

Argument which can be used to jump back to another page than the default table list for table designs.

$caller : string

Default

''
 

Indicates where a create index statement failed

$create_index_failed : boolean | null

Default

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

Default

''
 

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

Default

''
 

Indicates where a create table statement succeeded

$create_table_succeeded : boolean | null

Default

null
 

Holds all available databases

$database : array

Default

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

Default

false
 

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

Default

null
 

$fulltext_support

$fulltext_support 

Default

false
 

Indicates whether the design has indexes.

$indexes_found : boolean

Default

false
 

Indicates whether the table is a WordPress table

$is_wp_table : boolean | null

Default

false
 

Object of type WPDA_Design_Table_Model used for data manipulation

$model : object | null

Default

null
 

Page name (wpda_designer)

$page : string | null

Default

null
 

Holds the structure of the real physical database indexes

$real_indexes : array | null

Default

null
 

Holds the structure of the real physical database table

$real_table : array | null

Default

null
 

Indicates whether the structure of the database table equals the table design

$table_altered : boolean | null

Default

false
 

Named array holding table columns

$table_columns : array | null

Default

null
 

Indicates whether the table was found in the database

$table_exists : boolean | null

Default

null
 

Indicates whether indexes were updated in the actual design.

$updated_indexes : boolean

Default

false
 

Schema name

$wpda_schema_name : string | null

Default

null
 

Table design (taken from WPDA_Design_Table_Model)

$wpda_table_design : array | null

Default

null
 

Table name

$wpda_table_name : string | null

Default

null
 

Last error from wpdb

$wpdb_error : string | null

Default

null

 Constants

 

NEW_LINE

NEW_LINE = '<br/>'