Skip to main content

GravityKit\GravityMigrate\Platforms\ContactForm7\ContactForm7Definition

What GravityMigrate knows about Contact Form 7.

Since: %ver%

Source: src/Platforms/ContactForm7/ContactForm7Definition.php:19

Details

  • Kind: class

  • Namespace: GravityKit\GravityMigrate\Platforms\ContactForm7

  • Implements: PlatformDefinition

Methods

MethodDescription
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 special mail tags Contact Form 7 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/ContactForm7/ContactForm7Definition.php:114

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/ContactForm7/ContactForm7Definition.php:121

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/ContactForm7/ContactForm7Definition.php:128

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/ContactForm7/ContactForm7Definition.php:135

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/ContactForm7/ContactForm7Definition.php:142

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/ContactForm7/ContactForm7Definition.php:149

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/ContactForm7/ContactForm7Definition.php:169

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/ContactForm7/ContactForm7Definition.php:176

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/ContactForm7/ContactForm7Definition.php:191

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.

Contact Form 7 keeps a form in one class and both sides go through it.

Parameters

NameTypeDefaultDescription
$directionstringEither import or export.

Returns

  • string[] — Class, interface or function names, all of which must be present.

Since: %ver%

Source: src/Platforms/ContactForm7/ContactForm7Definition.php:202

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/ContactForm7/ContactForm7Definition.php:209

verified_against()

public static function verified_against(): string

The plugin version the registry above was read from.

Returns

  • string

Since: %ver%

Source: src/Platforms/ContactForm7/ContactForm7Definition.php:216

live_merge_tags()

public static function live_merge_tags(): array

The special mail tags Contact Form 7 says it has on this site.

There is no list to read. Contact Form 7 registers them as listeners on wpcf7_special_mail_tags, a filter that answers "what is this tag worth" rather than "what tags exist", and a listener cannot be asked which names it handles. So this reports nothing, which is a gap in what can be known rather than a gap in the looking.

Returns

  • string[]

Since: %ver%

Source: src/Platforms/ContactForm7/ContactForm7Definition.php:317