Skip to main content

GravityKit\GravityMigrate\Exporters\Adapters\AbstractTargetAdapter

Provides shared adapter helpers and exporter access.

Since: %ver%

Source: src/Exporters/Adapters/AbstractTargetAdapter.php:26

Details​

  • Kind: class

  • Namespace: GravityKit\GravityMigrate\Exporters\Adapters

  • Implements: TargetAdapterInterface

Properties​

PropertyTypeDescription
$exporterAbstractExporterExporter context.
$dropped_merge_tagsstring[]Merge tags removed from this export because the destination has no equivalent.
$export_notesstring[]Losses that are a sentence rather than the name of a merge tag.

Methods​

MethodDescription
__construct()Constructor.
build_prepared_payload()Builds a prepared payload for exporting a Gravity Forms form.
build_from_universal()Builds the prepared payload from a universal form, without the hub in the middle.

Method Reference​

__construct()​

public function __construct( AbstractExporter $exporter )

Constructor.

Parameters​

NameTypeDefaultDescription
$exporterAbstractExporterExporter context.

Since: %ver%

Source: src/Exporters/Adapters/AbstractTargetAdapter.php:533

build_prepared_payload()​

final public function build_prepared_payload( array $gf_form ): array

Builds a prepared payload for exporting a Gravity Forms form.

The sequence every export runs, owned here so that an adapter fills in its steps rather than restating the order. Seven adapters each carried their own copy, and a report key added to the envelope had to be added seven times; target_content was added to two.

The order: forget the previous form's losses and the adapter's own state, fill the hub form out to the shape Gravity Forms expects, convert it (\self::convert()), gather what the conversion said with what the base recorded on its behalf -- the merge tags it removed, the losses it noted, the form settings this destination declares it cannot express -- and assemble the payload every surface reads.

Parameters​

NameTypeDefaultDescription
$gf_formarrayThe form as the hub stores one.

Returns​

  • array

Since: %ver%

Source: src/Exporters/Adapters/AbstractTargetAdapter.php:556

build_from_universal()​

final public function build_from_universal( UniversalForm $form ): array

Builds the prepared payload from a universal form, without the hub in the middle.

The counterpart of \GravityKit\GravityMigrate\Importers\Adapters\AbstractSourceAdapter::to_universal_form(): a source adapter's universal form, projected by the hub's own writer, is the form every target adapter already knows how to read. The sequence is the same one build_prepared_payload() runs, so a form arriving this way is reported the same way.

Parameters​

NameTypeDefaultDescription
$formUniversalFormThe form as a source adapter read it.

Returns​

  • array

Since: %ver%

Source: src/Exporters/Adapters/AbstractTargetAdapter.php:609