Term_Purge
Class Term_Purge
Deletes imported terms that no longer exist in BigCommerce
- Full name:
\BigCommerce\Import\Processors\Term_Purge - This class implements:
\BigCommerce\Import\Processors\Import_Processor - This class is an Abstract class
Constants
| Constant | Visibility | Type | Value |
|---|---|---|---|
STATE_OPTION | public | string | ’bigcommerce_purge_terms_state’ |
Properties
catalog_api
public \BigCommerce\Api\v3\Api\CatalogApi $catalog_apibatch_size
public int $batch_sizeMethods
__construct
Category_Import constructor.
public __construct(\BigCommerce\Api\v3\Api\CatalogApi $catalog_api, int $batch_size): mixedParameters:
| Parameter | Type | Description |
|---|---|---|
$catalog_api | \BigCommerce\Api\v3\Api\CatalogApi | |
$batch_size | int |
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(): voidThis 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:
| Parameter | Type | Description |
|---|---|---|
$ids | int[] | The IDs of terms to check against |
Throws:
Inherited methods
get_option
protected get_option(string $option, bool $default = false): mixedParameters:
| Parameter | Type | Description |
|---|---|---|
$option | string | |
$default | bool |
update_option
protected update_option(string $option, mixed $value, bool $autoload = false): boolParameters:
| Parameter | Type | Description |
|---|---|---|
$option | string | |
$value | mixed | |
$autoload | bool |
add_option
protected add_option(string $option, mixed $value, bool $autoload = false): boolParameters:
| Parameter | Type | Description |
|---|---|---|
$option | string | |
$value | mixed | |
$autoload | bool |
delete_option
protected delete_option(string $option): boolParameters:
| Parameter | Type | Description |
|---|---|---|
$option | string |
Automatically generated on 2025-01-21