Class WPDP_Project_Design_Table_Model extends WPDA_Plugin_Table_Base_Model

Base class to handle standard plugin table features

see \WPDataAccess\Plugin_Table_Models\WPDA_Plugin_Table_Base_Model
author Peter Schulz
since 2.0.0
package WPDataAccess\Plugin_Table_Models
inherited_from \WPDataAccess\Plugin_Table_Models\WPDA_Plugin_Table_Base_Model

 Methods

WPDP_Project_Design_Table_Model constructor

__construct() 

Get action2 arguments

Check if const BASE_TABLE_NAME is defined (cannot proceed without)

check_base_table_name() 
InheritedStatic

Return number of records in base table

count() : integer
InheritedStatic

Returns

integer

Get base table name

get_base_table_name() : string
InheritedStatic

Returns

stringBase table name

Get column options for specific table name and label type

get_column_options(string $table_name, string $label_type, string $setname = 'default', $schema_name = '') : array | null
Static

Parameters

$table_name

string

Database table name

$label_type

string

Label type

$setname

string

Options set name

$schema_name

Returns

arraynull

Return table design

get_table_design() : null | array

Returns

nullarray

Return table design

get_table_setname() : null | array

Returns

nullarray

Overwrites method insert_reverse_engineered to add table options

insert_reverse_engineered($wpda_table_name, $wpda_table_setname, $wpda_table_design, $wpda_schema_name = '') : boolean
Static

Parameters

$wpda_table_name

$wpda_table_setname

$wpda_table_design

$wpda_schema_name

Returns

boolean

Prepare query to use setname (after reverse engineering)

prepare_query($wpda_table_setname) 

Parameters

$wpda_table_setname

Overwrite method prepare_update to prepare table options

prepare_update() 

Get design for a specific table name

query() : integer

Returns

integerNumber of rows.

Reconcile table

reconcile(object $table_structure, string $param_keep_options) : mixed

Parameters

$table_structure

object

Table structure

$param_keep_options

string

Possible values: 'on' and 'off'

Returns

mixedResult of SQL update

Get table design from function arguments instead of HTTP arguments

static_query($wpda_schema_name, $wpda_table_name, $wpda_set_name) : mixed | null
Static

Parameters

$wpda_schema_name

$wpda_table_name

$wpda_set_name

Returns

mixednull

Check if base table exists

table_exists() : boolean
InheritedStatic

Returns

booleanTRUE = table found

Update table design

update() : boolean

Returns

booleanTRUE = update successfull, FALSE ; update failed.

Overwrite method validate to add table options validation

validate() : array

Returns

array

Get table column options

get_column_options_from_request() : array | null

Returns

arraynull

Set table options for list table to prepare update

prepare_update_listtable() 

Set relationships to prepare update

prepare_update_relation() 

Set table options for data entry form to prepare update

prepare_update_tableform() 

Set table level options to prepare update

prepare_update_tableinfo() 

Reconcile a columns

reconcile_add_column(object $column, $label_list, $label_form) 

Parameters

$column

object

Column info

$label_list

$label_form

 Properties

 

Requested action

$action2 : string

Default

 

Cached table options

$cache_table_options : null | array

Default

null
Static
 

Name of table where design is stored

$table_name : string | null

Default

null
 

Design schema name

$wpda_schema_name : string

Default

''
 

The actual table design

$wpda_table_design : string | null

Default

null
 

Design table name

$wpda_table_name : string | null

Default

null
 

Options set name (to allow multiple table definitions)

$wpda_table_setname : string

Default

null
 

Check if options set name was changed

$wpda_table_setname_old : string

Default

null

 Constants

 

Base table name (without prefixes): MUST BE DEFINED IN SUBCLASS!!!

BASE_TABLE_NAME = 'wpda_project_table' 
inherited_from \WPDataAccess\Plugin_Table_Models\WPDA_Plugin_Table_Base_Model::BASE_TABLE_NAME
 

Base table name (without prefixes): MUST BE DEFINED IN SUBCLASS!!!

BASE_TABLE_NAME = null