Automattic\WooCommerce\Internal\PushNotifications\DataStores

StepLogTableReader::get_window_start_timestamp │ private │ WC 1.0

Returns the timestamp of the oldest row in the window just read, to decide whether the scan has passed the start of the range.

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

Хуков нет.

Возвращает

int|null. Null when the window held no rows at all.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_window_start_timestamp( $table, $lower ): ?int;
$table(строка) (обязательный)
The log table name.
$lower(int) (обязательный)
The exclusive lower ID bound of the window just read.

Код StepLogTableReader::get_window_start_timestamp() WC 11.3.0

private function get_window_start_timestamp( string $table, int $lower ): ?int {
	global $wpdb;

	$timestamp = $wpdb->get_var(
		$wpdb->prepare(
			"SELECT timestamp FROM {$table} WHERE log_id > %d ORDER BY log_id ASC LIMIT 1", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
			$lower
		)
	);

	return null === $timestamp ? null : (int) strtotime( $timestamp . ' UTC' );
}