WC_Product_Factory::get_product_id PHP Method

get_product_id() private method

Get the product ID depending on what was passed.
Since: 2.7.0
private get_product_id ( mixed $product ) : integer | boolean
$product mixed
return integer | boolean false on failure
    private function get_product_id($product)
    {
        if (is_numeric($product)) {
            return $product;
        } elseif ($product instanceof WC_Product) {
            return $product->get_id();
        } elseif (!empty($product->ID)) {
            return $product->ID;
        } else {
            return false;
        }
    }