Class WPDA_Simple_Form_Data

WPDA_Simple_Form_Data is responsible for data management. It queries the database, adds new records to tables and updates table data. Simple validations are performed based on information retrieved from the data dictionary.

author Peter Schulz
since 1.0.0
package WPDataAccess\Simple_Form

 Methods

WPDA_Simple_Form_Data constructor

__construct(string $schema_name, string $table_name, \WPDataAccess\Data_Dictionary\WPDA_List_Columns $wpda_list_columns, \WPDataAccess\Simple_Form\WPDA_Simple_Form $calling_form, string $wpda_success_msg, string $wpda_failure_msg) 

Check if table exists and access is granted.

since 1.0.0

Parameters

$schema_name

string

Database schema name.

$table_name

string

Database table name.

$wpda_list_columns

\WPDataAccess\Data_Dictionary\WPDA_List_Columns

Reference to column array.

$calling_form

\WPDataAccess\Simple_Form\WPDA_Simple_Form

Reference to calling form.

$wpda_success_msg

string

Message shown on success.

$wpda_failure_msg

string

Message shown on failure.

Add records to database table

add_row() : boolean
since 1.0.0

Returns

booleanTRUE = record successfully added to table

Get record from database table

get_row(integer $auto_increment_value, string $wpda_err) : mixed
since 1.0.0

Parameters

$auto_increment_value

integer

Auto increment number (returned if provided by dbms).

$wpda_err

string

Error message to be shown on failure.

Returns

mixed

Create new record

new_row() : null

Nothing to do!

since 1.0.0

Returns

null

Update current record (write changes to database)

set_row() 
since 1.0.0

 Properties

 

Reference to calling form

$calling_form : \WPDataAccess\Simple_Form\WPDA_Simple_Form

Default

 

Database schema name

$schema_name : string

Default

 

Database table name

$table_name : string

Default

 

Handle to data dictionary object

$wpda_data_dictionary : \WPDataAccess\Data_Dictionary\WPDA_Dictionary_Exist

Default

 

Default failure message

$wpda_failure_msg : string

Default

Is set in the constructor to support internationalization.

 

Reference to column list

$wpda_list_columns : \WPDataAccess\Data_Dictionary\WPDA_List_Columns

Default

 

Default succes message

$wpda_success_msg : string

Default

Is set in the constructor to support internationalization.