Automattic\WooCommerce\Internal\BatchProcessing
BatchProcessingController::get_process_details
Get the current state for a given enqueued processor.
Method of the class: BatchProcessingController{}
No Hooks.
Returns
Array. Current state for the processor, or a "blank" state if none exists yet.
Usage
// private - for code of main (parent) class only $result = $this->get_process_details( $batch_processor ): array;
- $batch_processor(BatchProcessorInterface) (required)
- Batch processor instance.
BatchProcessingController::get_process_details() BatchProcessingController::get process details code WC 10.8.1
private function get_process_details( BatchProcessorInterface $batch_processor ): array {
$defaults = array(
'total_time_spent' => 0,
'current_batch_size' => $batch_processor->get_default_batch_size(),
'last_error' => null,
'recent_failures' => 0,
'batch_first_failure' => null,
'batch_last_failure' => null,
);
$process_details = get_option( $this->get_processor_state_option_name( $batch_processor ) );
$process_details = wp_parse_args( is_array( $process_details ) ? $process_details : array(), $defaults );
return $process_details;
}