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.

Метод класса: StepLogQuery{}

Хуков нет.

Возвращает

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

Использование

$StepLogQuery = new StepLogQuery();
$StepLogQuery->for_token( $token_id, $from, $to, $limit ): array;
$token_id(int) (обязательный)
The push token post ID.
$from(int) (обязательный)
Earliest timestamp, inclusive.
$to(int) (обязательный)
Latest timestamp, inclusive.
$limit(int) (обязательный)
Rows to return, newest first.

Список изменений

С версии 11.3.0 Введена.

Код StepLogQuery::for_token() 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 ) )
	);
}