Automattic\WooCommerce\Internal\PushNotifications\Services

StepLogQuery::read │ private │ WC 1.0

Reads one source through the reader that matches the store's handler.

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

Хуков нет.

Возвращает

array{rows: array, covered_from: int, has_more: bool}.

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

// private - только в коде основоного (родительского) класса
$result = $this->read( $source, $from, $to, $limit, ?callable $expand ): array;
$source(строка) (обязательный)
The log source.
$from(int) (обязательный)
Earliest timestamp, inclusive.
$to(int) (обязательный)
Latest timestamp, inclusive.
$limit(int) (обязательный)
The fewest rows the reader collects before stopping.
?callable $expand(обязательный)
.

Код StepLogQuery::read() WC 11.3.0

private function read( string $source, int $from, int $to, int $limit, ?callable $expand ): array {
	$handler = LoggingUtil::get_default_handler();

	if ( is_a( $handler, WC_Log_Handler_DB::class, true ) ) {
		return $this->table_reader->read( $source, $from, $to, $limit, $expand );
	}

	if ( is_a( $handler, LogHandlerFileV2::class, true ) ) {
		return $this->file_reader->read( $source, $from, $to, $limit, $expand );
	}

	return array(
		'rows'         => array(),
		'covered_from' => $to,
		'has_more'     => false,
	);
}