Automattic\WooCommerce\Internal\PushNotifications\Entities

PushToken::set_user_idpublicWC 10.4.0

Sets the user ID.

Method of the class: PushToken{}

No Hooks.

Returns

null. Nothing (null).

Usage

$PushToken = new PushToken();
$PushToken->set_user_id( $user_id ): void;
$user_id(int) (required)
The id of the user who owns the token.

Changelog

Since 10.4.0 Introduced.

PushToken::set_user_id() code WC 10.5.0

public function set_user_id( int $user_id ): void {
	if ( $user_id <= 0 ) {
		throw new InvalidArgumentException( 'User ID must be a positive integer.' );
	}

	$this->user_id = $user_id;
}