WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Customers

DataStore::get_customer_id_by_user_id() public WC 1.0

Retrieve a registered customer row id by user_id.

{} It's a method of the class: DataStore{}

No Hooks.

Return

false|Int. Customer ID if found, boolean false if not.

Usage

$result = DataStore::get_customer_id_by_user_id( $user_id );
$user_id(string|int) (required)
User ID.

Code of DataStore::get_customer_id_by_user_id() WC 5.3.0

<?php
public static function get_customer_id_by_user_id( $user_id ) {
	global $wpdb;

	$table_name  = self::get_db_table_name();
	$customer_id = $wpdb->get_var(
		$wpdb->prepare(
			// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
			"SELECT customer_id FROM {$table_name} WHERE user_id = %d LIMIT 1",
			$user_id
		)
	);

	return $customer_id ? (int) $customer_id : false;
}