Automattic\WooCommerce\Internal\BatchProcessing

BatchProcessingController::get_processor_state_option_name()privateWC 1.0

Get the name of the option where we will be saving state for a given processor.

Method of the class: BatchProcessingController{}

No Hooks.

Return

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) (required)
Batch processor instance.

BatchProcessingController::get_processor_state_option_name() code WC 8.7.0

private function get_processor_state_option_name( BatchProcessorInterface $batch_processor ): string {
	$class_name = get_class( $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;
}