Automattic\WooCommerce\Internal\BatchProcessing
BatchProcessingController::get_processor_state_option_name
Get the name of the option where we will be saving state for a given processor.
Method of the class: BatchProcessingController{}
No Hooks.
Returns
String. Option name.
Usage
// private - for code of main (parent) class only $result = $this->get_processor_state_option_name( $batch_processor ): string;
- $batch_processor(BatchProcessorInterface|string) (required)
- Batch processor instance or class name.
BatchProcessingController::get_processor_state_option_name() BatchProcessingController::get processor state option name code WC 10.3.3
private function get_processor_state_option_name( $batch_processor ): string {
$class_name = is_a( $batch_processor, BatchProcessorInterface::class ) ? get_class( $batch_processor ) : $batch_processor;
$class_md5 = md5( $class_name );
// truncate the class name so we know that it will fit in the option name column along with md5 hash and prefix.
$class_name = substr( $class_name, 0, 140 );
return 'wc_batch_' . $class_name . '_' . $class_md5;
}