Automattic\WooCommerce\Internal\PushNotifications\Entities

PushToken::set_origin │ public │ WC 10.4.0

Validates and sets the origin.

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

Хуков нет.

Возвращает

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

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

$PushToken = new PushToken();
$PushToken->set_origin( $origin ): void;
$origin(строка) (обязательный)
The origin of the token, e.g. the app it came from.

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

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

Код PushToken::set_origin() WC 11.2.1

public function set_origin( string $origin ): void {
	$result = PushTokenValidator::validate( compact( 'origin' ), array( 'origin' ) );

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

	$this->origin = trim( $origin );
}