Automattic\WooCommerce\Internal\PushNotifications\Services
StepLogQuery::for_site
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.
Метод класса: StepLogQuery{}
Хуков нет.
Возвращает
array{rows: array, counts: array<string, int>, covered_from: int, next_to: int|null, logging: array}.
Использование
$StepLogQuery = new StepLogQuery(); $StepLogQuery->for_site( $from, $to, $limit ): array;
- $from(int) (обязательный)
- Earliest timestamp, inclusive.
- $to(int) (обязательный)
- Latest timestamp, inclusive.
- $limit(int) (обязательный)
- Rows to return, newest first.
Список изменений
| С версии 11.3.0 | Введена. |
Код StepLogQuery::for_site() StepLogQuery::for site 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 );
}