Overview

Classes

  • GF_Background_Upgrader
  • GF_Download
  • GF_Forms_Model_Legacy
  • GF_Query_Call
  • GF_Query_Column
  • GF_Query_Condition
  • GF_Query_Literal
  • GF_Query_Series
  • GF_Upgrade
  • GFAddOn
  • GFAddOnFeedsTable
  • GFAPI
  • GFFeedAddOn
  • GFPaymentAddOn
  • GFPaymentStatsTable
  • Gravity_Api

Functions

  • gapi
  • Overview
  • Class

Class GF_Forms_Model_Legacy

Class GF_Forms_Model_Legacy

Legacy methods from GFFormsModel

Located at legacy/forms_model_legacy.php
Methods summary
public static string
# get_form_table_name( )

Gets the form table name, including the site's database prefix.

Gets the form table name, including the site's database prefix.

Returns

string
The form table name.

Since

Unknown
public static string
# get_meta_table_name( )

Gets the form meta table, including the site's database prefix.

Gets the form meta table, including the site's database prefix.

Returns

string
The form meta table.

Since

Unknown
public static string
# get_form_view_table_name( )

Gets the form view table name, including the site's database prefix.

Gets the form view table name, including the site's database prefix.

Returns

string
The form view table name.

Since

Unknown
public static string
# get_lead_table_name( )

Gets the lead (entries) table name, including the site's database prefix

Gets the lead (entries) table name, including the site's database prefix

Returns

string
The lead (entry) table name
public static string
# get_lead_meta_table_name( )

Gets the lead (entry) meta table name, including the site's database prefix

Gets the lead (entry) meta table name, including the site's database prefix

Returns

string
The lead (entry) meta table name
public static string
# get_lead_notes_table_name( )

Gets the lead (entry) notes table name, including the site's database prefix

Gets the lead (entry) notes table name, including the site's database prefix

Returns

string
The lead (entry) notes table name
public static string
# get_lead_details_table_name( )

Gets the lead (entry) details table name, including the site's database prefix

Gets the lead (entry) details table name, including the site's database prefix

Returns

string
The lead (entry) details table name
public static string
# get_lead_details_long_table_name( )

Gets the lead (entry) details long table name, including the site's database prefix

Gets the lead (entry) details long table name, including the site's database prefix

Returns

string
The lead (entry) details long table name
public static string
# get_lead_view_name( )

Gets the lead (entry) view table name, including the site's database prefix

Gets the lead (entry) view table name, including the site's database prefix

Returns

string
The lead (entry) view table name
public static string
# get_incomplete_submissions_table_name( )

Gets the incomplete submissions table name, including the site's database prefix

Gets the incomplete submissions table name, including the site's database prefix

Returns

string
The incomplete submissions table name
public static
# get_legacy_tables( )
public static array
# get_entry_count_per_form( )

Gets the number of entries 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

Since

2.3 lead_count changed to entry_count

See

GFFormsModel::get_lead_table_name
GFCache::get
GFCache::set
public static array
# get_form_counts( integer $form_id )

Gets the total, unread, starred, spam, and trashed entry counts.

Gets the total, unread, starred, spam, and trashed entry counts.

Parameters

$form_id
The ID of the form to check.

Returns

array
$results[0] The form counts.

Since

Unknown

Uses

GFFormsModel::get_lead_table_name()
GFFormsModel::get_lead_details_table_name()
public static
# update_leads_property( $leads, $property_name, $property_value )
public static
# update_lead_property( $lead_id, $property_name, $property_value, $update_akismet = true, $disable_hook = false )
public static
# delete_leads( $leads )
public static
# delete_lead( $lead_id )
public static
# delete_leads_by_form( $form_id, $status = '' )
public static
# delete_files_by_form( $form_id, $status = '' )
public static
# delete_file( $entry_id, $field_id, $file_index = 0 )
public static
# get_lead( $lead_id )
public static
# delete_field_values( $form_id, $field_id )
public static
# save_lead( $form, & $lead )
public static
# save_input( $form, $field, & $lead, $current_fields, $input_id )
public static
# is_duplicate( $form_id, $field, $value )
public static
# get_lead_notes( $lead_id )
public static
# get_leads_by_meta( $meta_key, $meta_value )
public static
# get_leads( $form_id, $sort_field_number = 0, $sort_direction = 'DESC', $search = '', $offset = 0, $page_size = 30, $star = null, $read = null, $is_numeric_sort = false, $start_date = null, $end_date = null, $status = 'active', $payment_status = false )
public static
# get_leads_where_sql( $args )
public static
# get_lead_count( $form_id, $search, $star = null, $read = null, $start_date = null, $end_date = null, $status = null, $payment_status = null )
public static
# get_lead_ids( $form_id, $search, $star = null, $read = null, $start_date = null, $end_date = null, $status = null, $payment_status = null )
public static
# get_submitted_fields( $form_id )
public static
# search_leads( $form_id, $search_criteria = array(), $sorting = null, $paging = null )
public static
# search_lead_ids( $form_id, $search_criteria = array() )
public static
# build_lead_array( $results )
public static
# get_lead_db_columns( )
public static boolean
# is_valid_operator( string $operator )

Checks whether the conditional logic operator passed in is valid.

Checks whether the conditional logic operator passed in is valid.

Parameters

$operator
Conditional logic operator.

Returns

boolean
true if a valid operator, false if not.

Since

2.0.7.20 Refactored and added filter gform_is_valid_conditional_logic_operator.
public static
# get_entry_meta( $form_ids )
public static
# count_search_leads( $form_id, $search_criteria = array() )
public static
# get_entry_meta_counts( )
public static
# gform_get_meta( $entry_id, $meta_key )
public static
# gform_get_meta_values_for_entries( $entry_ids, $meta_keys )
public static
# gform_update_meta( integer $entry_id, string $meta_key, mixed $meta_value, integer|null $form_id = null )

Add or update metadata associated with an entry

Add or update metadata associated with an entry

Data will be serialized. Don't forget to sanitize user input.

Parameters

$entry_id
The ID of the entry to be updated
$meta_key
The key for the meta data to be stored
$meta_value
The data to be stored for the entry
$form_id
The form ID of the entry (optional, saves extra query if passed when creating the metadata)
public static
# gform_add_meta( integer $entry_id, string $meta_key, mixed $meta_value, integer|null $form_id = null )

Add metadata associated with an entry

Add metadata associated with an entry

Data will be serialized; Don't forget to sanitize user input.

Parameters

$entry_id
The ID of the entry where metadata is to be added
$meta_key
The key for the meta data to be stored
$meta_value
The data to be stored for the entry
$form_id
The form ID of the entry (optional, saves extra query if passed when creating the metadata)
public static
# gform_delete_meta( $entry_id, $meta_key = '' )
public static true|WP_Error
# update_entry( array $entry, integer $entry_id = null )

Updates an entire single Entry object.

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

$entry
The Entry Object.
$entry_id
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

Uses

\GFAPI::get_entry
\GFAPI::form_id_exists
\GFFormsModel::get_ip
\GFFormsModel::get_current_page_url
\GFCommon::get_currency
\GFFormsModel::get_lead_table_name
\GFFormsModel::get_lead_details_table_name
\GFFormsModel::get_form_meta
\GFFormsModel::get_input_type
\GF_Field::get_entry_inputs
\GFFormsModel::get_lead_detail_id
\GFFormsModel::update_lead_field_value
\GFFormsModel::get_entry_meta
\GFFormsModel::get_field
public static integer|WP_Error
# add_entry( array $entry )

Adds a single Entry object.

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

$entry
The Entry Object.

Returns

integer|WP_Error
Either the new Entry ID or a WP_Error instance.

Since

1.8

Uses

GFAPI::form_id_exists()
GFFormsModel::get_ip()
GFFormsModel::get_current_page_url()
GFCommon::get_currency()
GFFormsModel::get_lead_table_name()
GF_Field::get_entry_inputs()
GFFormsModel::update_lead_field_value()
GFFormsModel::get_entry_meta()
GFAPI::get_entry()
public static boolean|array
# update_entry_field( integer $entry_id, string $input_id, mixed $value )

Updates a single field of an entry.

Updates a single field of an entry.

Parameters

$entry_id
The ID of the Entry object.
$input_id

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
The value to which the field should be set.

Returns

boolean|array
Whether the entry property was updated successfully. If there's an error getting the entry, the entry object.

Since

1.9

Uses

GFAPI::get_entry()
GFAPI::get_form()
GFFormsModel::get_field()
GFFormsModel::get_lead_details_table_name()
GFFormsModel::update_lead_field_value()
public static
# get_lead_detail_id( $current_fields, $field_number )
public static boolean
# update_lead_field_value( array $form, array $lead, GF_Field $field, integer $lead_detail_id, string $input_id, string $value )

Updates an existing field value in the database.

Updates an existing field value in the database.

Parameters

$form
$lead
$field
$lead_detail_id
$input_id
$value

Returns

boolean
public static
# add_note( $lead_id, $user_id, $user_name, $note, $note_type = 'note' )
public static
# delete_note( $note_id )
public static
# get_lead_count_all_forms( $status = 'active' )
Gravity Forms API API documentation generated by ApiGen