Automattic\WooCommerce\Internal\StockNotifications

Factory::get_notificationpublic staticWC 1.0

Get the notification object.

Method of the class: Factory{}

No Hooks.

Returns

Notification|true|false.

Usage

$result = Factory::get_notification( $notification_id );
$notification_id(int) (required)
Notification ID to get.

Factory::get_notification() code WC 10.3.6

public static function get_notification( int $notification_id ) {

	if ( ! $notification_id ) {
		return false;
	}

	try {
		$notification = new Notification( $notification_id );
		return $notification;
	} catch ( \Exception $e ) {
		\wc_caught_exception( $e, __FUNCTION__, array( $notification_id ) );
		return false;
	}
}