Automattic\WooCommerce\Internal\PushNotifications\Services
StepLogQuery::for_user
Returns every step recorded against every token one user owns.
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_user( $user_id, $from, $to, $limit ): array;
- $user_id(int) (required)
- The user.
- $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_user() StepLogQuery::for user code WC 11.3.0
public function for_user( int $user_id, int $from, int $to, int $limit ): array {
$token_ids = $this->data_store->get_token_ids_for_user( $user_id );
return $this->query(
self::get_token_sources(),
$from,
$to,
$limit,
fn( array $row ) => self::split_line_into_token_rows( $row, $token_ids )
);
}