Automattic\WooCommerce\Internal\PushNotifications\Controllers

StepLogRestController::get_notification │ protected │ WC 11.3.0

Handles the notification journey request.

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

Хуков нет.

Возвращает

WP_REST_Response.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_notification( $request ): WP_REST_Response;
$request(WP_REST_Request) (обязательный)
The request object.

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

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

Код StepLogRestController::get_notification() WC 11.3.0

protected function get_notification( WP_REST_Request $request ): WP_REST_Response {
	list( $from, $to ) = $this->get_range( $request );

	return new WP_REST_Response(
		$this->query->for_notification(
			(string) $request->get_param( 'type' ),
			(int) $request->get_param( 'resource_id' ),
			$from,
			$to,
			$this->get_limit( $request )
		)
	);
}