clean code

This commit is contained in:
Frédéric FRANCE 2021-11-23 22:55:35 +01:00
parent 99cddfa235
commit 6cbc3c6033
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
3 changed files with 2 additions and 36 deletions

View File

@ -1947,23 +1947,6 @@ class Categorie extends CommonObject
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables, 1);
}
/**
* Function used to replace a product id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old product id
* @param int $dest_id New product id
* @return bool
*/
public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
{
$tables = array(
'categorie_product'
);
return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
}
/**
* Return the addtional SQL JOIN query for filtering a list by a category
*

View File

@ -2503,23 +2503,6 @@ class Expedition extends CommonObject
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
}
/**
* Function used to replace a product id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old product id
* @param int $dest_id New product id
* @return bool
*/
public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
{
$tables = array(
'expeditiondet'
);
return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
}
}

View File

@ -311,14 +311,14 @@ if (empty($reshook)) {
// TODO add this functionality into the api_products.class.php
// TODO Mutualise the list into object product.class.php
$objects = array(
'Categorie' => '/categories/class/categorie.class.php',
// do not use Categorie, it cause foreign key error, merge is done before
//'Categorie' => '/categories/class/categorie.class.php',
'Propal' => '/comm/propal/class/propal.class.php',
'Commande' => '/commande/class/commande.class.php',
'Facture' => '/compta/facture/class/facture.class.php',
'FactureRec' => '/compta/facture/class/facture-rec.class.php',
'Bom' => '/bom/class/bom.class.php',
'Contrat' => '/contrat/class/contrat.class.php',
'Expedition' => '/expedition/class/expedition.class.php',
'Reception' => '/reception/class/reception.class.php',
'Fichinter' => '/fichinter/class/fichinter.class.php',
'FichinterRec' => '/fichinter/class/fichinter.class.php',