Skip to main content

GravityKit\GravityMigrate\Migration\ImportRequest

Stages a bundle and works out what of it to import.

Forms and data types are checked against the BUNDLE, never against this site: importing form 4 means the bundle's form 4, and this site's form 4 is a different form sharing a number. A refusal names the bundle's contents for the same reason.

Since: %ver%

Source: src/Migration/ImportRequest.php:24

Details

  • Kind: class
  • Namespace: GravityKit\GravityMigrate\Migration

Methods

MethodDescription
resolve()The staged bundle and the payload that imports it, or the refusal that stops it.
forms()The bundle's form ids this import covers.
data()The data types to import, intersected with what the bundle actually carries.

Method Reference

resolve()

public static function resolve( array $input, Import $import )

The staged bundle and the payload that imports it, or the refusal that stops it.

Parameters

NameTypeDefaultDescription
$inputarrayImport request: path (the bundle on this server), forms (ids in the BUNDLE), all_forms, data (data types), skip_uploads.
$importImportThe import engine, which reads the bundle.

Returns

  • array{payload:array, — forms:array, data:array, bundle_forms:array, bundle_data:array}|WP_Error

Since: %ver%

Source: src/Migration/ImportRequest.php:72

forms()

public static function forms( array $input, array $bundle_forms )

The bundle's form ids this import covers.

Public because it is answerable without a bundle in hand -- given what a bundle carries, this is what an import of it would touch -- and because the rules in it are the ones worth holding to a test.

Parameters

NameTypeDefaultDescription
$inputarrayInput as received.
$bundle_formsarrayEvery form id the bundle carries, in the bundle's own types.

Returns

Since: %ver%

Source: src/Migration/ImportRequest.php:188

data()

public static function data( array $input, array $bundle_data )

The data types to import, intersected with what the bundle actually carries.

Parameters

NameTypeDefaultDescription
$inputarrayInput as received.
$bundle_dataarrayEvery data type the bundle carries.

Returns

Since: %ver%

Source: src/Migration/ImportRequest.php:237