GF_Forms_Model_Legacy
Class GF_Forms_Model_Legacy
Legacy methods from GFFormsModel
Source: includes/legacy/forms_model_legacy.php:12
Details
- Kind:
class - Namespace:
(global)
Methods
| Method | Description |
|---|---|
get_form_table_name() | Gets the form table name, including the site's database prefix. |
get_meta_table_name() | Gets the form meta table, including the site's database prefix. |
get_form_view_table_name() | Gets the form view table name, including the site's database prefix. |
get_lead_table_name() | Gets the lead (entries) table name, including the site's database prefix |
get_lead_meta_table_name() | Gets the lead (entry) meta table name, including the site's database prefix |
get_lead_notes_table_name() | Gets the lead (entry) notes table name, including the site's database prefix |
get_lead_details_table_name() | Gets the lead (entry) details table name, including the site's database prefix |
get_lead_details_long_table_name() | Gets the lead (entry) details long table name, including the site's database prefix |
get_lead_view_name() | Gets the lead (entry) view table name, including the site's database prefix |
get_incomplete_submissions_table_name() | Gets the incomplete submissions table name, including the site's database prefix |
get_entry_count_per_form() | Gets the number of entries per form. |
get_form_counts() | Gets the total, unread, starred, spam, and trashed entry counts. |
is_valid_operator() | Checks whether the conditional logic operator passed in is valid. |
gform_update_meta() | Add or update metadata associated with an entry |
gform_add_meta() | Add metadata associated with an entry |
update_entry() | Updates an entire single Entry object. |
form_id_exists() | Private. |
add_entry() | Adds a single Entry object. |
update_entry_field() | Updates a single field of an entry. |
update_lead_field_value() | Updates an existing field value in the database. |
Method Reference
get_form_table_name()
public static function get_form_table_name()
Gets the form table name, including the site's database prefix.
Returns
string— The form table name.
Since: Unknown
Source: includes/legacy/forms_model_legacy.php:23
get_meta_table_name()
public static function get_meta_table_name()
Gets the form meta table, including the site's database prefix.
Returns
string— The form meta table.
Since: Unknown
Source: includes/legacy/forms_model_legacy.php:37
get_form_view_table_name()
public static function get_form_view_table_name()
Gets the form view table name, including the site's database prefix.
Returns
string— The form view table name.
Since: Unknown
Source: includes/legacy/forms_model_legacy.php:51
get_lead_table_name()
public static function get_lead_table_name()
Gets the lead (entries) table name, including the site's database prefix
Returns
string— The lead (entry) table name
Source: includes/legacy/forms_model_legacy.php:66
get_lead_meta_table_name()
public static function get_lead_meta_table_name()
Gets the lead (entry) meta table name, including the site's database prefix
Returns
string— The lead (entry) meta table name
Source: includes/legacy/forms_model_legacy.php:81
get_lead_notes_table_name()
public static function get_lead_notes_table_name()
Gets the lead (entry) notes table name, including the site's database prefix
Returns
string— The lead (entry) notes table name
Source: includes/legacy/forms_model_legacy.php:96
get_lead_details_table_name()
public static function get_lead_details_table_name()
Gets the lead (entry) details table name, including the site's database prefix
Returns
string— The lead (entry) details table name
Source: includes/legacy/forms_model_legacy.php:111
get_lead_details_long_table_name()
public static function get_lead_details_long_table_name()
Gets the lead (entry) details long table name, including the site's database prefix
Returns
string— The lead (entry) details long table name
Source: includes/legacy/forms_model_legacy.php:126
get_lead_view_name()
public static function get_lead_view_name()
Gets the lead (entry) view table name, including the site's database prefix
Returns
string— The lead (entry) view table name
Source: includes/legacy/forms_model_legacy.php:141
get_incomplete_submissions_table_name()
public static function get_incomplete_submissions_table_name()
Gets the incomplete submissions table name, including the site's database prefix
Returns
string— The incomplete submissions table name
Source: includes/legacy/forms_model_legacy.php:156
get_entry_count_per_form()
public static function get_entry_count_per_form()
Gets the number of entries per form.
First attempts to read from cache. If unavailable, gets the entry count, caches it, and returns it.
Returns
array— $entry_count Array of forms, containing the form ID and the entry count
See Also
GFFormsModel::get_lead_table_nameGFCache::getGFCache::set
Since: 2.3 (lead_count changed to entry_count)
Source: includes/legacy/forms_model_legacy.php:193
get_form_counts()
public static function get_form_counts( $form_id )
Gets the total, unread, starred, spam, and trashed entry counts.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | The ID of the form to check. |
Returns
array— $results[0] The form counts.
Since: Unknown
Source: includes/legacy/forms_model_legacy.php:223
is_valid_operator()
public static function is_valid_operator( $operator )
Checks whether the conditional logic operator passed in is valid.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$operator | string | Conditional logic operator. |
Returns
bool— true if a valid operator, false if not.
Since: 2.0.7.20 (Refactored and added filter gform_is_valid_conditional_logic_operator.)
Source: includes/legacy/forms_model_legacy.php:1705
gform_update_meta()
public static function gform_update_meta( $entry_id, $meta_key, $meta_value, $form_id=null )
Add or update metadata associated with an entry
Data will be serialized. Don't forget to sanitize user input.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry_id | int | The ID of the entry to be updated | |
$meta_key | string | The key for the meta data to be stored | |
$meta_value | mixed | The data to be stored for the entry | |
$form_id | int | null | null | The form ID of the entry (optional, saves extra query if passed when creating the metadata) |
Source: includes/legacy/forms_model_legacy.php:1967
gform_add_meta()
public static function gform_add_meta( $entry_id, $meta_key, $meta_value, $form_id=null )
Add metadata associated with an entry
Data will be serialized; Don't forget to sanitize user input.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry_id | int | The ID of the entry where metadata is to be added | |
$meta_key | string | The key for the meta data to be stored | |
$meta_value | mixed | The data to be stored for the entry | |
$form_id | int | null | null | The form ID of the entry (optional, saves extra query if passed when creating the metadata) |
Source: includes/legacy/forms_model_legacy.php:2009
update_entry()
public static function update_entry( $entry, $entry_id=null )
Updates an entire single Entry object.
If the date_created value is not set then the current time UTC will be used. The date_created value, if set, is expected to be in 'Y-m-d H:i:s' format (UTC).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The Entry Object. | |
$entry_id | int | null | Optional. If specified, the ID in the Entry Object will be ignored. Defaults to null. |
Returns
true| WP_Error — Either True or a WP_Error instance
Since: 1.8
Source: includes/legacy/forms_model_legacy.php:2072
form_id_exists()
public static function form_id_exists( $form_id )
Private.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id |
Since: 1.8
Source: includes/legacy/forms_model_legacy.php:2274
add_entry()
public static function add_entry( $entry )
Adds a single Entry object.
Intended to be used for importing an entry object. The usual hooks that are triggered while saving entries are not fired here. Checks that the form id, field ids and entry meta exist and ignores legacy values (i.e. values for fields that no longer exist).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | The Entry Object. |
Returns
int| WP_Error — Either the new Entry ID or a WP_Error instance.
Since: 1.8
Source: includes/legacy/forms_model_legacy.php:2317
update_entry_field()
public static function update_entry_field( $entry_id, $input_id, $value )
Updates a single field of an entry.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry_id | int | The ID of the Entry object. | |
$input_id | string | The id of the input to be updated. For single input fields such as text, paragraph, website, drop down etc... this will be the same as the field ID. For multi input fields such as name, address, checkboxes, etc... the input id will be in the format {FIELD_ID}.{INPUT NUMBER}. ( i.e. "1.3" ). The $input_id can be obtained by inspecting the key for the specified field in the $entry object. | |
$value | mixed | The value to which the field should be set. |
Returns
bool|array— Whether the entry property was updated successfully. If there's an error getting the entry, the entry object.
Since: 1.9
Source: includes/legacy/forms_model_legacy.php:2454
update_lead_field_value()
public static function update_lead_field_value( $form, $lead, $field, $lead_detail_id, $input_id, $value )
Updates an existing field value in the database.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | ||
$lead | array | ||
$field | GF_Field | ||
$lead_detail_id | int | ||
$input_id | string | ||
$value | string |
Returns
bool
Source: includes/legacy/forms_model_legacy.php:2506