Automattic\WooCommerce\Internal\ProductFeed\Integrations\POSCatalog
AsyncGenerator::update_feed_progress
Updates the feed progress while the feed is being generated.
Метод класса: AsyncGenerator{}
Хуков нет.
Возвращает
Массив. Updated status of the feed generation.
Использование
// private - только в коде основоного (родительского) класса $result = $this->update_feed_progress( $status, $progress ): array;
- $status(массив) (обязательный)
- The last previously known status.
- $progress(WalkerProgress) (обязательный)
- The progress of the walker.
Код AsyncGenerator::update_feed_progress() AsyncGenerator::update feed progress WC 10.5.2
private function update_feed_progress( array $status, WalkerProgress $progress ): array {
$status['progress'] = $progress->total_count > 0
? round( ( $progress->processed_items / $progress->total_count ) * 100, 2 )
: 0;
$status['processed'] = $progress->processed_items;
$status['total'] = $progress->total_count;
return $status;
}