Automattic\WooCommerce\Internal\PushNotifications\Services

StepLogQuery::for_site │ public │ WC 11.3.0

Returns every step recorded on the store.

Reads every notification type's source, the store-wide suppressed source and the module's error source. No source is per token, so the number of files read does not grow with the number of devices the store holds.

Method of the class: StepLogQuery{}

No Hooks.

Returns

array{rows: array, counts: array<string, int>, covered_from: int, next_to: int|null, logging: array}.

Usage

$StepLogQuery = new StepLogQuery();
$StepLogQuery->for_site( $from, $to, $limit ): array;
$from(int) (required)
Earliest timestamp, inclusive.
$to(int) (required)
Latest timestamp, inclusive.
$limit(int) (required)
Rows to return, newest first.

Changelog

Since 11.3.0 Introduced.

StepLogQuery::for_site() code WC 11.3.0

public function for_site( int $from, int $to, int $limit ): array {
	$sources = array_map(
		array( NotificationStepLogger::class, 'get_notification_source_for_type' ),
		array_keys( Notification::NOTIFICATION_CLASSES )
	);

	$sources[] = NotificationStepLogger::SUPPRESSED_SOURCE;
	$sources[] = PushNotifications::FEATURE_NAME;

	return $this->query( $sources, $from, $to, $limit );
}