Skip to main content

GravityKit\GravityMigrate\Migration\PendingMigrations

Marks each form before its migration writes anything and clears the mark once the form is

migrated, so a run that dies or fails partway leaves the mark behind.

A destination form is recorded as migrated only after it is created, and for exports only after further writes, so a run killed in between leaves a form nothing records. A retry that trusted the record alone would create it again.

Since: 2.1.1

Source: src/Migration/PendingMigrations.php:22

Details​

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

Methods​

MethodDescription
mark()Marks a form as being written.
clear()Clears a form's mark once its migration is known to have finished.
is_pending()Whether a run stopped partway through this form.

Method Reference​

mark()​

public static function mark( string $direction, string $platform, $form_id ): void

Marks a form as being written.

One option per form, so two requests marking different forms never overwrite each other.

Parameters​

NameTypeDefaultDescription
$directionstring\ExternalMigration::DIRECTION_TO() or \ExternalMigration::DIRECTION_FROM().
$platformstringThe provider's slug.
$form_idstring | intSource form id.

Returns​

  • void

Since: 2.1.1

Source: src/Migration/PendingMigrations.php:37

clear()​

public static function clear( string $direction, string $platform, $form_id ): void

Clears a form's mark once its migration is known to have finished.

Parameters​

NameTypeDefaultDescription
$directionstring\ExternalMigration::DIRECTION_TO() or \ExternalMigration::DIRECTION_FROM().
$platformstringThe provider's slug.
$form_idstring | intSource form id.

Returns​

  • void

Since: 2.1.1

Source: src/Migration/PendingMigrations.php:52

is_pending()​

public static function is_pending( string $direction, string $platform, $form_id ): bool

Whether a run stopped partway through this form.

Parameters​

NameTypeDefaultDescription
$directionstring\ExternalMigration::DIRECTION_TO() or \ExternalMigration::DIRECTION_FROM().
$platformstringThe provider's slug.
$form_idstring | intSource form id.

Returns​

  • bool

Since: 2.1.1

Source: src/Migration/PendingMigrations.php:67