// Updated Supply Order + import CSV

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11856 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2011-12-28 15:08:07 +00:00
parent 13ec8072ff
commit 76533c40bd
2 changed files with 48 additions and 1 deletions
+20
View File
@@ -447,6 +447,26 @@ class SupplyOrderCore extends ObjectModel
return ($res > 0);
}
/**
* For a given reference, returns the corresponding supply order
*
* @param striing $reference
* @return bool|SupplyOrder
*/
public static function getSupplyOrderByReference($reference)
{
if (!$reference)
return false;
$query = new DbQuery();
$query->select('id_supply_order');
$query->from('supply_order', 'so');
$query->where('so.reference = "'.pSQL($match).'"');
$id = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
return (new SupplyOrder((int)$id));
}
/**
* Webservice : gets the ids supply_order_detail associated to this order
* @return array