static public function findBySKU($nb_commerce, string $sku)
    {
        $retval = false;
        $nb_commerce_id = nb_getMixedValue($nb_commerce, NABU_COMMERCE_FIELD_ID);
        if (is_numeric($nb_commerce_id)) {
            $retval = CNabuCommerceProduct::buildObjectFromSQL(
                'SELECT *
                   from nb_commerce_product
                  where nb_commerce_id=%commerce_id$d
                    and nb_commerce_product_sku=\'%sku$s\'
                ',
                array(
                    'commerce_id' => $nb_commerce_id,
                    'sku' => $sku
                )
            );
        }

        return $retval;
    }
static public function findBySKU($nb_commerce, string $sku)
    {
        $retval = false;
        $nb_commerce_id = nb_getMixedValue($nb_commerce, NABU_COMMERCE_FIELD_ID);
        if (is_numeric($nb_commerce_id)) {
            $retval = CNabuCommerceProduct::buildObjectFromSQL(
                'SELECT *
                   from nb_commerce_product
                  where nb_commerce_id=%commerce_id$d
                    and nb_commerce_product_sku=\'%sku$s\'
                ',
                array(
                    'commerce_id' => $nb_commerce_id,
                    'sku' => $sku
                )
            );
        }

        return $retval;
    }
static public function findBySKU ( $ nb_commerce , string $ sku ) { $ retval = false ; $ nb_commerce_id = nb_getMixedValue ( $ nb_commerce , NABU_COMMERCE_FIELD_ID ) ; if ( is_numeric ( $ nb_commerce_id ) ) { $ retval = CNabuCommerceProduct :: buildObjectFromSQL ( 'SELECT *
                   from nb_commerce_product
                  where nb_commerce_id=%commerce_id$d
                    and nb_commerce_product_sku=\'%sku$s\'
                ' , array ( 'commerce_id' => $ nb_commerce_id , 'sku' => $ sku ) ) ; } return $ retval ; }
Find a product in a Commerce by its SKU.
@param mixed $nb_commerce A CNabuDataObject instance containing a field named nb_commerce_id or a valid ID.
@param string $sku The SKU to be found.
@return CNabuCommerceProduct|false Returns a valid instance if found, or false if not found.
Find a product in a Commerce by its SKU .