GravityKit\GravityMigrate\Platforms\GravityForms\GravityFormsTargetAdapter
Turns a UniversalForm into a Gravity Forms form.
Being the hub is a role rather than a reason to be shaped differently, so this is an adapter like the others and writes its platform the way the WPForms adapter writes WPForms.
Since: %ver%
Source: src/Platforms/GravityForms/GravityFormsTargetAdapter.php:28
Details
- Kind:
class - Namespace:
GravityKit\GravityMigrate\Platforms\GravityForms - Extends:
AbstractTargetAdapter
Methods
| Method | Description |
|---|---|
notification_from_universal() | Writes a universal notification as a Gravity Forms one. |
confirmation_from_universal() | Writes a universal confirmation as a Gravity Forms one. |
conditional_logic_from_universal() | Writes universal conditional logic as Gravity Forms logic. |
from_universal() | Projects a UniversalForm to a Gravity Forms form array. |
field_from_universal() | Projects a UniversalField to a Gravity Forms field array. |
build_prepared_payload() | Builds a prepared payload for exporting a Gravity Forms form. |
Method Reference
notification_from_universal()
public static function notification_from_universal( UniversalNotification $notification ): array
Writes a universal notification as a Gravity Forms one.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$notification | UniversalNotification | Notification. |
Returns
array— A single entry for a form'snotifications.
Since: %ver%
Source: src/Platforms/GravityForms/GravityFormsTargetAdapter.php:39
confirmation_from_universal()
public static function confirmation_from_universal( UniversalConfirmation $confirmation ): array
Writes a universal confirmation as a Gravity Forms one.
Only the key the type calls for is written. Carrying all three would leave a url on a message confirmation, which is invisible until somebody switches it to a redirect and finds an address from a form they migrated months ago.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$confirmation | UniversalConfirmation | Confirmation. |
Returns
array— A single entry for a form'sconfirmations.
Since: %ver%
Source: src/Platforms/GravityForms/GravityFormsTargetAdapter.php:75
conditional_logic_from_universal()
public static function conditional_logic_from_universal( ?UniversalConditionalLogic $logic )
Writes universal conditional logic as Gravity Forms logic.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$logic | UniversalConditionalLogic | null | Logic, or null when there is none. |
Returns
array|string— The Gravity Forms structure, or the empty string it uses for no logic.
Since: %ver%
Source: src/Platforms/GravityForms/GravityFormsTargetAdapter.php:179
from_universal()
public static function from_universal( UniversalForm $form ): array
Projects a UniversalForm to a Gravity Forms form array.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | UniversalForm | UniversalForm. |
Returns
array
Since: %ver%
Source: src/Platforms/GravityForms/GravityFormsTargetAdapter.php:223
field_from_universal()
public static function field_from_universal( UniversalField $field ): array
Projects a UniversalField to a Gravity Forms field array.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | UniversalField | UniversalField. |
Returns
array
Since: %ver%
Source: src/Platforms/GravityForms/GravityFormsTargetAdapter.php:275
build_prepared_payload()
public function build_prepared_payload( array $gf_form ): array
Builds a prepared payload for exporting a Gravity Forms form.
Gravity Forms is the hub, so the payload for it is the form itself. The conversion this adapter performs is from_universal().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$gf_form | array | Gravity Forms form. |
Returns
array
Since: %ver%
Source: src/Platforms/GravityForms/GravityFormsTargetAdapter.php:352