Skip to main content

GravityKit\GravityMigrate\Background\ImportedDataTypes

Records what a finished run moved, so every screen that reports the run says the same thing.

Written by the importer's completion request, which the browser loop and the background driver both reach; read by that request's payload and by the settings page of a tab opened after the run ended. Kept on an option the way \ImportedForms keeps the forms.

Stored as ids and counts rather than rendered rows, so a label is translated when read.

Since: %ver%

Source: src/Background/ImportedDataTypes.php:24

Details

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

Methods

MethodDescription
record()Writes the run's list, replacing whatever an earlier run left.
summary()What the recorded run moved, ready to render.
clear()Clears the list.

Method Reference

record()

public static function record( array $data_types, array $rows=[] ): void

Writes the run's list, replacing whatever an earlier run left.

Parameters

NameTypeDefaultDescription
$data_typesstring[]Data-type ids, in the order the run finished them.
$rowsarray[]id => row count, for the types the importer counted. A type absent here is reported with no count rather than with zero.

Returns

  • void

Since: %ver%

Source: src/Background/ImportedDataTypes.php:37

summary()

public static function summary(): array

What the recorded run moved, ready to render.

Returns

  • array<int,array{id: — string, label: string, rows: int|null}> Empty when no run has been recorded.

Since: %ver%

Source: src/Background/ImportedDataTypes.php:62

clear()

public static function clear(): void

Clears the list.

Called when a run starts, so a page never reports the run before it beside this run's forms.

Returns

  • void

Since: %ver%

Source: src/Background/ImportedDataTypes.php:85