Skip to main content

GravityKit\GravityMigrate\Exporters\Adapters\TargetConversion

The outcome of converting one hub form for a destination: the form as that platform stores

one, and what the conversion had to say about it.

The seam between a target adapter's own work and the sequence the base class runs around it. An adapter hands one of these back from \AbstractTargetAdapter::convert(); the base adds what every export reports the same way and assembles the prepared payload.

Named methods rather than array keys, for the reason \GravityKit\GravityMigrate\Importers\Adapters\SourceConversion gives: a channel an adapter forgets is an absent call, and a misspelled one is a fatal on the first test that reaches it.

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:24

Details

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

Methods

MethodDescription
of()A conversion that produced this native form, to travel under this key.
set_title()Names the migrated form, where the destination's settings hold a title of their own.
add_warnings()Adds what the destination could not carry, in sentences.
add_unsupported()Adds the hub fields the destination could make nothing of.
add_addon_requirements()Adds what the destination needs installed.
set_field_map()Records which destination identifier each hub field became.
payload_key()The key the native form travels under.
native_form()The form as the destination stores one.
title()The migrated form's title, where the destination named one.
warnings()What the destination could not carry, in sentences.
unsupported()The hub fields the destination could make nothing of.
addon_requirements()What the destination needs installed.
field_map()Hub field id => destination identifier.

Method Reference

of()

public static function of( string $payload_key, array $native_form ): self

A conversion that produced this native form, to travel under this key.

Parameters

NameTypeDefaultDescription
$payload_keystringThe key the exporter reads the native form from.
$native_formarrayThe form as the destination stores one.

Returns

  • self

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:113

set_title()

public function set_title( string $title ): self

Names the migrated form, where the destination's settings hold a title of their own.

Parameters

NameTypeDefaultDescription
$titlestringThe title.

Returns

  • self

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:126

add_warnings()

public function add_warnings( array $warnings ): self

Adds what the destination could not carry, in sentences.

Parameters

NameTypeDefaultDescription
$warningsstring[]Sentences. Duplicates and blanks are dropped when reported.

Returns

  • self

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:141

add_unsupported()

public function add_unsupported( array $unsupported ): self

Adds the hub fields the destination could make nothing of.

Parameters

NameTypeDefaultDescription
$unsupportedarrayAs the field mapper collected them: labels, or records carrying a label, one entry per FIELD.

Returns

  • self

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:157

add_addon_requirements()

public function add_addon_requirements( array $requirements ): self

Adds what the destination needs installed.

Parameters

NameTypeDefaultDescription
$requirementsstring[]Sentences, or add-on names, already grouped where the destination groups them.

Returns

  • self

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:173

set_field_map()

public function set_field_map( array $field_map ): self

Records which destination identifier each hub field became.

Parameters

NameTypeDefaultDescription
$field_maparrayHub field id => destination identifier.

Returns

  • self

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:188

payload_key()

public function payload_key(): string

The key the native form travels under.

Returns

  • string

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:201

native_form()

public function native_form(): array

The form as the destination stores one.

Returns

  • array

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:212

title()

public function title(): ?string

The migrated form's title, where the destination named one.

Returns

  • string | null — Null when the destination named no title of its own.

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:223

warnings()

public function warnings(): array

What the destination could not carry, in sentences.

Returns

  • string[]

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:234

unsupported()

public function unsupported(): array

The hub fields the destination could make nothing of.

Returns

  • array

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:245

addon_requirements()

public function addon_requirements(): array

What the destination needs installed.

Returns

  • string[]

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:256

field_map()

public function field_map(): array

Hub field id => destination identifier.

Returns

  • array

Since: %ver%

Source: src/Exporters/Adapters/TargetConversion.php:267