Skip to main content

GravityKit\GravityMigrate\Exporters\Controller

Handles AJAX endpoints for exporting Gravity Forms to third-party providers.

Since: %ver%

Source: src/Exporters/Controller.php:26

Details​

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

Properties​

PropertyTypeDescription
$registryTargetRegistryExporter registry.
$utilUtilUtility helper.

Methods​

MethodDescription
__construct()Controller constructor.
register_routes()Registers controller routes with GravityKit Foundation.
list_exporters()Returns available exporters.
list_forms()Returns Gravity Forms forms for export.
analyze_forms()Analyses several forms in one request.
analyze_form()Analyses a form for export.
export_form()Exports a form to a provider.

Method Reference​

__construct()​

public function __construct( TargetRegistry $registry, ?Util $util=null )

Controller constructor.

Parameters​

NameTypeDefaultDescription
$registryTargetRegistryExporter registry instance.
$utilUtil | nullnullUtility helper; the shared instance when omitted.

Since: %ver%

Source: src/Exporters/Controller.php:85

register_routes()​

public function register_routes( $routes ): array

Registers controller routes with GravityKit Foundation.

Parameters​

NameTypeDefaultDescription
$routesarrayExisting routes.

Returns​

  • array

Since: %ver%

Source: src/Exporters/Controller.php:101

list_exporters()​

public function list_exporters( $payload ): array

Returns available exporters.

Parameters​

NameTypeDefaultDescription
$payloadarrayRequest payload.

Returns​

  • array

Since: %ver%

Source: src/Exporters/Controller.php:118

list_forms()​

public function list_forms( $payload ): array

Returns Gravity Forms forms for export.

Parameters​

NameTypeDefaultDescription
$payloadarrayRequest payload.

Returns​

  • array

Since: %ver%

Source: src/Exporters/Controller.php:165

analyze_forms()​

public function analyze_forms( $payload ): array

Analyses several forms in one request.

The Forms step asks what each form loses on the way across, and asked once per form: a site with a hundred forms paid for a hundred WordPress boots to do a few milliseconds of work each. Everything expensive -- validating the request, resolving the provider, fetching the exporter -- happens once here for the whole set.

A form that cannot be read is reported against its own id rather than thrown, because the screen marks one card per form: a batch that failed whole would blank a screenful of answers over one bad form. Only failures that apply to every id equally -- a bad nonce, a missing capability, an unavailable exporter -- refuse the request.

Parameters​

NameTypeDefaultDescription
$payloadarrayRequest payload.

Returns​

  • array

Since: %ver%

Source: src/Exporters/Controller.php:227

analyze_form()​

public function analyze_form( $payload ): array

Analyses a form for export.

Parameters​

NameTypeDefaultDescription
$payloadarrayRequest payload.

Returns​

  • array

Since: %ver%

Source: src/Exporters/Controller.php:277

export_form()​

public function export_form( $payload ): array

Exports a form to a provider.

Parameters​

NameTypeDefaultDescription
$payloadarrayRequest payload.

Returns​

  • array

Since: %ver%

Source: src/Exporters/Controller.php:334