function getProductComposition(&$PDOdb, $id_product, $quantite_to_make, $fk_nomenclature = 0, $fk_assetOf_line_parent = 0) { global $db, $conf; $Tab = array(); if ($conf->nomenclature->enabled) { dol_include_once('/nomenclature/class/nomenclature.class.php'); //$TNomen = TNomenclature::get($PDOdb, $id_product); if ($fk_nomenclature) { $TNomen = new TNomenclature(); $TNomen->load($PDOdb, $fk_nomenclature); if (!empty($TNomen)) { $TRes = $TNomen->getDetails($quantite_to_make); $this->getProductComposition_arrayMerge($PDOdb, $Tab, $TRes, 1, true, $fk_assetOf_line_parent); } } } else { include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; $product = new Product($db); $product->fetch($id_product); $TRes = $product->getChildsArbo($product->id); // var_dump($TRes); $this->getProductComposition_arrayMerge($PDOdb, $Tab, $TRes, $quantite_to_make); } return $Tab; }