Automattic\WooCommerce\Internal\BatchProcessing
BatchProcessingController::get_process_details
Get the current state for a given enqueued processor.
Метод класса: BatchProcessingController{}
Хуков нет.
Возвращает
Массив. Current state for the processor, or a "blank" state if none exists yet.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_process_details( $batch_processor ): array;
- $batch_processor(BatchProcessorInterface) (обязательный)
- Batch processor instance.
Код BatchProcessingController::get_process_details() BatchProcessingController::get process details WC 10.9.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;
}