Automattic\WooCommerce\Internal\Orders

MobileMessagingHandler::get_last_used_or_null()private staticWC 1.0

Returns last used date of specified mobile app platform.

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

Хуков нет.

Возвращает

?DateTime. last used date of specified mobile app

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

$result = MobileMessagingHandler::get_last_used_or_null(;

Код MobileMessagingHandler::get_last_used_or_null() WC 7.1.0

private static function get_last_used_or_null(
	string $platform, array $mobile_usage
): ?DateTime {
	try {
		if ( array_key_exists( $platform, $mobile_usage ) ) {
			return new DateTime( $mobile_usage[ $platform ]['last_used'] );
		} else {
			return null;
		}
	} catch ( Exception $e ) {
		return null;
	}
}