Skip to main content

GravityKit\GravityMigrate\Exporters\ExporterInterface

Describes the methods required for all external form exporters.

Since: %ver%

Source: src/Exporters/ExporterInterface.php:17

Details​

  • Kind: interface
  • Namespace: GravityKit\GravityMigrate\Exporters

Methods​

MethodDescription
get_slug()Returns the unique slug used to reference the exporter.
get_name()Returns the human-readable exporter name.
get_description()Returns a short description of the exporter.
is_available()Whether the exporter can run on the current site (dependencies active, etc).
missing_requirements()Which of this platform's requirements are not installed here.
list_forms()Returns a list of exportable Gravity Forms forms.
analyze_form()Reports what the requested Gravity Forms form loses on the way to the target provider.
export_form()Exports a Gravity Forms form to the target provider.
translate_merge_tags()Converts Gravity Forms merge tags into provider-specific tokens.

Method Reference​

get_slug()​

public function get_slug(): string

Returns the unique slug used to reference the exporter.

Returns​

  • string

Since: %ver%

Source: src/Exporters/ExporterInterface.php:26

get_name()​

public function get_name(): string

Returns the human-readable exporter name.

Returns​

  • string

Since: %ver%

Source: src/Exporters/ExporterInterface.php:35

get_description()​

public function get_description(): string

Returns a short description of the exporter.

Returns​

  • string

Since: %ver%

Source: src/Exporters/ExporterInterface.php:44

is_available()​

public function is_available(): bool

Whether the exporter can run on the current site (dependencies active, etc).

Returns​

  • bool

Since: %ver%

Source: src/Exporters/ExporterInterface.php:53

missing_requirements()​

public function missing_requirements(): array

Which of this platform's requirements are not installed here.

The reason behind \self::is_available(): an empty list is what makes it true, and the names are what tells an operator which plugin to activate.

Returns​

  • string[] — Class, interface or function names that resolve to nothing on this site.

Since: %ver%

Source: src/Exporters/ExporterInterface.php:65

list_forms()​

public function list_forms( array $args=[] ): array

Returns a list of exportable Gravity Forms forms.

Parameters​

NameTypeDefaultDescription
$argsarray[]Optional request arguments.

Returns​

  • array — Associative arrays carrying at least id and title.

Since: %ver%

Source: src/Exporters/ExporterInterface.php:76

analyze_form()​

public function analyze_form( $form_id, array $args=[] )

Reports what the requested Gravity Forms form loses on the way to the target provider.

Parameters​

NameTypeDefaultDescription
$form_idmixedGravity Forms form identifier.
$argsarray[]Optional request arguments.

Returns​

  • array | WP_Error — Field notices and warnings, or WP_Error when the form cannot be read.

Since: %ver%

Source: src/Exporters/ExporterInterface.php:88

export_form()​

public function export_form( $form_id, array $args=[] )

Exports a Gravity Forms form to the target provider.

Parameters​

NameTypeDefaultDescription
$form_idmixedGravity Forms form identifier.
$argsarray[]Optional request arguments.

Returns​

  • array | WP_Error — target_form_id, edit_url and issues for the created form, or WP_Error describing the failure.

Since: %ver%

Source: src/Exporters/ExporterInterface.php:101

translate_merge_tags()​

public function translate_merge_tags( string $text, array $context=[] ): string

Converts Gravity Forms merge tags into provider-specific tokens.

Parameters​

NameTypeDefaultDescription
$textstringText containing Gravity Forms merge tags.
$contextarray[]Optional context data for replacements.

Returns​

  • string

Since: %ver%

Source: src/Exporters/ExporterInterface.php:113