Status

Manages the import process status tracking and logging system for BigCommerce imports.

This class maintains two logs: current and previous import statuses, storing timestamps and state transitions throughout the import process. It uses WordPress options to persist the status information without caching.

The class defines various status constants representing different stages of the import process, from initialization to completion, including product fetching, category updates, brand management, and image processing.

  • Full name: \BigCommerce\Import\Runner\Status

Constants

ConstantVisibilityTypeValue
NOT_STARTEDpublic’not_started’
STARTEDpublic’started’
ABORTEDpublic’aborted’
FETCHING_LISTINGSpublic’fetching_listings’
FETCHED_LISTINGSpublic’fetched_listings’
INITIALIZING_CHANNELpublic’initializing_channel’
INITIALIZED_CHANNELpublic’initialized_channel’
FETCHING_PRODUCTSpublic’fetching_products’
FETCHED_PRODUCTSpublic’fetched_products’
MARKING_DELETED_PRODUCTSpublic’marking_deleted_products’
MARKED_DELETED_PRODUCTSpublic’marked_deleted_products’
PROCESSING_QUEUEpublic’processing_queue’
PROCESSED_QUEUEpublic’processed_queue’
CLEANING_PRODUCTSpublic’cleaning_products’
CLEANED_PRODUCTSpublic’cleaned_products’
FETCHING_STOREpublic’fetching_store’
FETCHED_STOREpublic’fetched_store’
FETCHING_CURRENCIESpublic’fetching_currencies’
FETCHED_CURRENCIESpublic’fetched_currencies’
CLEANINGpublic’cleaning’
COMPLETEDpublic’completed’
FAILEDpublic’failed’
UPDATING_CATEGORIESpublic’updating_categories’
UPDATED_CATEGORIESpublic’updated_categories’
UPDATING_BRANDSpublic’updating_brands’
UPDATED_BRANDSpublic’updated_brands’
PURGING_CATEGORIESpublic’purging_categories’
PURGED_CATEGORIESpublic’purged_categories’
PURGING_BRANDSpublic’purging_brands’
PURGED_BRANDSpublic’purged_brands’
RESIZING_IMAGESpublic’resizing_images’
RESIZED_IMAGESpublic’resized_images’
CURRENT_LOGpublic’bigcommerce_current_import_status_log’
PREVIOUS_LOGpublic’bigcommerce_previous_import_status_log’

Methods

current_status

public current_status(): array

Return Value:

The timestamp and status of the last update to the current import


previous_status

public previous_status(): array

Return Value:

The timestamp and status of the last update to the previous import


set_status

Add a status to the log for the current import. The status will be appended to the log, even if it is the same as the current status.

public set_status(string $status): void

Parameters:

ParameterTypeDescription
$statusstring

rotate_logs

Overwrite the previous log with the current log and empty the current log

public rotate_logs(): void

Inherited methods

get_option

protected get_option(string $option, bool $default = false): mixed

Parameters:

ParameterTypeDescription
$optionstring
$defaultbool

update_option

protected update_option(string $option, mixed $value, bool $autoload = false): bool

Parameters:

ParameterTypeDescription
$optionstring
$valuemixed
$autoloadbool

add_option

protected add_option(string $option, mixed $value, bool $autoload = false): bool

Parameters:

ParameterTypeDescription
$optionstring
$valuemixed
$autoloadbool

delete_option

protected delete_option(string $option): bool

Parameters:

ParameterTypeDescription
$optionstring


Automatically generated on 2025-01-21