Automattic\WooCommerce\Internal\PushNotifications\Services

StepLogQuery::for_token │ public │ WC 11.3.0

Returns every step recorded against one token.

No line is stored per token, so this finds the token named inside the notification-level lines and returns a row for it.

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_token( $token_id, $from, $to, $limit ): array;
$token_id(int) (required)
The push token post ID.
$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_token() code WC 11.3.0

public function for_token( int $token_id, int $from, int $to, int $limit ): array {
	return $this->query(
		self::get_token_sources(),
		$from,
		$to,
		$limit,
		fn( array $row ) => self::split_line_into_token_rows( $row, array( $token_id ) )
	);
}