Term_Purge

Class Term_Purge

Deletes imported terms that no longer exist in BigCommerce

Constants

ConstantVisibilityTypeValue
STATE_OPTIONpublicstring’bigcommerce_purge_terms_state’

Properties

catalog_api

public \BigCommerce\Api\v3\Api\CatalogApi $catalog_api

batch_size

public int $batch_size

Methods

__construct

Category_Import constructor.

public __construct(\BigCommerce\Api\v3\Api\CatalogApi $catalog_api, int $batch_size): mixed

Parameters:

ParameterTypeDescription
$catalog_api\BigCommerce\Api\v3\Api\CatalogApi
$batch_sizeint

taxonomy

Gets the WordPress taxonomy identifier that this purge processor handles.

protected taxonomy(): string
  • This method is abstract.

Return Value:

The taxonomy name (e.g., ‘product_category’, ‘product_brand’).


running_state

Gets the status identifier for when this term purge process is running.

protected running_state(): string
  • This method is abstract.

Return Value:

The status identifier for the running state.


completed_state

Gets the status identifier for when this term purge process is completed.

protected completed_state(): string
  • This method is abstract.

Return Value:

The status identifier for the completed state.


run

Executes the term purge process.

public run(): void

This method handles the deletion of WordPress terms that no longer exist in BigCommerce. It processes terms in batches, comparing local terms with remote BigCommerce data. The process tracks its state to support pagination and can be resumed if interrupted.

Throws:

If there's an error communicating with the BigCommerce API.


get_remote_term_ids

Get the IDs of all terms found in the API that match the known terms

protected get_remote_term_ids(int[] $ids): int[]
  • This method is abstract.

Parameters:

ParameterTypeDescription
$idsint[]The IDs of terms to check against

Throws:


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