GravityKit\GravityMigrate\Platforms\FormidableForms\FormidableDefinition
What GravityMigrate knows about Formidable Forms.
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:19
Details
-
Kind:
class -
Namespace:
GravityKit\GravityMigrate\Platforms\FormidableForms -
Implements:
PlatformDefinition
Methods
| Method | Description |
|---|---|
platform() | The canonical platform id, matching FieldMapper's PLATFORM_* constants. |
aliases() | The slugs the importer and exporter registries use for this platform. |
to_universal() | This platform's field types, mapped to universal types. |
from_universal() | Universal types, mapped to this platform's field types. |
registered_types() | Every field type this platform registers, read from the plugin itself. |
intentional_asymmetry() | Platform types whose two directions differ on purpose, keyed by the type read. |
submit_types() | The subset of this platform's chrome that IS the form's submit button. |
chrome_types() | Types the platform registers that hold no submitted data. |
dropped_types() | Types this platform reads but cannot turn into a Gravity Forms field, with the reason. |
required_for() | What has to be installed for this platform to be read from or written to. |
is_hub() | Whether this is the platform every migration passes through. |
verified_against() | The plugin version the registry above was read from. |
live_merge_tags() | The shortcodes Formidable says it has on this site. |
Method Reference
platform()
public static function platform(): string
The canonical platform id, matching FieldMapper's PLATFORM_* constants.
Returns
string
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:221
aliases()
public static function aliases(): array
The slugs the importer and exporter registries use for this platform.
The registries use hyphenated slugs ('ninja-forms') while the schema uses underscored ids ('ninja_forms'), and several platforms answer to more than one spelling.
Returns
string[]
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:228
to_universal()
public static function to_universal(): array
This platform's field types, mapped to universal types.
Returns
array<string,— string>
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:235
from_universal()
public static function from_universal(): array
Universal types, mapped to this platform's field types.
Every value has to be a type the platform registers, because a platform renders nothing for a type it does not know and says nothing about it either.
Returns
array<string,— string>
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:242
registered_types()
public static function registered_types(): array
Every field type this platform registers, read from the plugin itself.
This is the list a written type is checked against. It is a pinned snapshot: the plugin is the authority, and this is what we last read from it.
Returns
string[]
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:249
intentional_asymmetry()
public static function intentional_asymmetry(): array
Platform types whose two directions differ on purpose, keyed by the type read.
A definition's two maps are meant to be inverses. Where they are not it is nearly always a bug -- one direction fixed and not the other -- but occasionally the type a platform hands us is not the type that behaves when we hand it back. Declaring those with the reason is what stops the disagreement being discovered later in somebody's migrated form.
Returns
array<string,— string> Platform type => why the two directions differ.
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:256
submit_types()
public static function submit_types(): array
The subset of this platform's chrome that IS the form's submit button.
Source adapters carry the button's text into the migrated form's own submit-button setting, so the field table must report it as the button rather than as "combined with another field", which is true of two name inputs becoming one Name field and false of a button.
Empty where the platform keeps its button on the form rather than in the field list, which is a real answer rather than a gap: WPForms reads settings.submit_text and Forminator submitData, so neither has a field to report.
Returns
string[]
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:282
chrome_types()
public static function chrome_types(): array
Types the platform registers that hold no submitted data.
A submit button, a section's add and delete icons, a preview panel showing what has been typed so far: real registered types that a real exported form contains, with nothing in them to carry. Declaring them separates a deliberate drop from a forgotten one, which are indistinguishable from the outside and have very different consequences.
Returns
string[]
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:289
dropped_types()
public static function dropped_types(): array
Types this platform reads but cannot turn into a Gravity Forms field, with the reason.
A type can be mapped correctly here and the adapter still produce nothing for it. Left undeclared, the definition claims a conversion that does not happen: a Ninja repeater says it becomes a Gravity Forms repeater while the import drops it, taking every child with it.
A drop declared here has to also be reported at migration time. Silent is the failure mode; a person who is told a field could not come across can go and rebuild it.
Returns
array<string,— string> Platform type => why nothing can be produced for it.
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:299
required_for()
public static function required_for( string $direction ): array
What has to be installed for this platform to be read from or written to.
Formidable keeps a form and its fields apart, and both sides need both.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$direction | string | Either import or export. |
Returns
string[]— Class, interface or function names, all of which must be present.
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:316
is_hub()
public static function is_hub(): bool
Whether this is the platform every migration passes through.
Being the hub is a role a platform fills, and this is the only place it is recorded: nothing else branches on the hub's name.
Returns
bool
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:323
verified_against()
public static function verified_against(): string
The plugin version the registry above was read from.
Returns
string
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:330
live_merge_tags()
public static function live_merge_tags(): array
The shortcodes Formidable says it has on this site.
FrmFieldsHelper::allowed_shortcodes() is the list Formidable substitutes, and it is built
as regex fragments rather than literals: post[-|_]id stands for both post-id and
post_id, and any field id on the form is appended to the same list. The underscore form is
taken here because that is what Formidable's own defaults write, and the field ids are left
out because a field reference is not a spelling; it follows the field.
Returns
string[]
Since: %ver%
Source: src/Platforms/FormidableForms/FormidableDefinition.php:415