GravityKit\GravityMigrate\Export
Gravity Forms export class.
Source: src/Export.php:20
Details
- Kind:
class - Namespace:
GravityKit\GravityMigrate
Methods
| Method | Description |
|---|---|
__construct() | Constructor. |
get_instance() | Returns class instance. |
get_gf_settings() | Returns Gravity Forms form settings allowed to be exported. |
get_gk_settings() | Returns GravityKit settings allowed to be exported. |
get_dates_filter_query() | Returns the WHERE statement for date filter. |
get_tables_where() | Returns the final WHERE statement to add to the export query. |
post_content_match_selection() | Checks if post content shortcodes' or blocks' attribute value matches user's selection of forms to export. |
get_table_structure() | Returns the table structure for the provided table. |
get_table_structure_keys() | Returns the keys of the provided table. |
get_nested_forms() | Returns Gravity Perks' Nested Forms. |
ajax_routes() | Exports the data & the dump file. |
generate_export_file_name() | Generate a filename for the export file. |
sanitize_file_name() | Sanitize filename by removing accents and applying other rules |
mysql_escape_mimic() | Mimics the mysql_real_escape_string function. Adapted from a post by 'feedr' on php.net. |
Method Reference
__construct()
public function __construct()
Constructor.
Since: 1.0.0
Source: src/Export.php:62
get_instance()
public static function get_instance(): Export
Returns class instance.
Returns
Export
Since: 1.0.0
Source: src/Export.php:76
get_gf_settings()
static public function get_gf_settings()
Returns Gravity Forms form settings allowed to be exported.
Returns
array
Since: 1.0.0
Source: src/Export.php:163
get_gk_settings()
static public function get_gk_settings()
Returns GravityKit settings allowed to be exported.
Returns
array
Since: 1.0.0
Source: src/Export.php:184
get_dates_filter_query()
public function get_dates_filter_query( $start_date='', $end_date='' )
Returns the WHERE statement for date filter.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$start_date | string | '' | DATE FORMAT: YYYY-MM-DD. |
$end_date | string | '' | DATE FORMAT: YYYY-MM-DD. |
Returns
string
Since: 1.0.0
Source: src/Export.php:198
get_tables_where()
public function get_tables_where( $forms='', $entries_date_filter_query='' )
Returns the final WHERE statement to add to the export query.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$forms | string | '' | Comma-separated list of form IDs. |
$entries_date_filter_query | string | '' | AND statement with start date AND/OR end date. |
Returns
array
Since: 1.0.0
Source: src/Export.php:220
post_content_match_selection()
public function post_content_match_selection( $content, $forms_arr )
Checks if post content shortcodes' or blocks' attribute value matches user's selection of forms to export.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$content | string | Post content. | |
$forms_arr | array | User's selection of forms to export. |
Returns
bool|array
Since: 1.1.0
Source: src/Export.php:464
get_table_structure()
public function get_table_structure( $table_name )
Returns the table structure for the provided table.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$table_name | string | Table name. |
Returns
array|bool
Since: 1.0.0
Source: src/Export.php:609
get_table_structure_keys()
public function get_table_structure_keys( $table_name )
Returns the keys of the provided table.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$table_name | string | Table name. |
Returns
array
Since: 1.0.0
Source: src/Export.php:626
get_nested_forms()
public function get_nested_forms( $selected_forms )
Returns Gravity Perks' Nested Forms.
Merged with selected forms.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$selected_forms |
Returns
array
Since: 1.0.0
Source: src/Export.php:646
ajax_routes()
public function ajax_routes( $routes )
Exports the data & the dump file.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$routes | array | Foundation routes. |
Returns
array
Since: 1.0.0
Source: src/Export.php:713
generate_export_file_name()
public function generate_export_file_name()
Generate a filename for the export file.
gk-migrate-{domain}-{date generated in Y-m-d}-{timestamp}.zip
Returns
string
Since: 1.0.0
Source: src/Export.php:1030
sanitize_file_name()
public function sanitize_file_name( $filename )
Sanitize filename by removing accents and applying other rules
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$filename | string |
Returns
string
Source: src/Export.php:1068
mysql_escape_mimic()
static public function mysql_escape_mimic( $input )
Mimics the mysql_real_escape_string function. Adapted from a post by 'feedr' on php.net.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$input | string | array | The string to escape. |
Returns
string|array
Since: 1.0.0
Source: src/Export.php:1091