Automattic\WooCommerce\Internal\PushNotifications\Entities

PushToken::set_id │ public │ WC 10.4.0

Validates and sets the ID.

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

Хуков нет.

Возвращает

void. Ничего (null).

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

$PushToken = new PushToken();
$PushToken->set_id( $id ): void;
$id(int) (обязательный)
The ID of the token post.

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

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

Код PushToken::set_id() WC 11.3.0

public function set_id( int $id ): void {
	$result = PushTokenValidator::validate( compact( 'id' ), array( 'id' ) );

	if ( is_wp_error( $result ) ) {
		// phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
		throw new PushTokenInvalidDataException( $result->get_error_message() );
	}

	$this->id = $id;
}