Automattic\WooCommerce\Internal\PushNotifications\Entities
PushToken::set_user_id
Validates and sets the user ID.
Метод класса: PushToken{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$PushToken = new PushToken(); $PushToken->set_user_id( $user_id ): void;
- $user_id(int) (обязательный)
- The ID of the user who owns the token.
Список изменений
| С версии 10.4.0 | Введена. |
Код PushToken::set_user_id() PushToken::set user id WC 11.3.0
public function set_user_id( int $user_id ): void {
$result = PushTokenValidator::validate( compact( 'user_id' ), array( 'user_id' ) );
if ( is_wp_error( $result ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
throw new PushTokenInvalidDataException( $result->get_error_message() );
}
$this->user_id = $user_id;
}