From c4e775bc8ef6cc2c0014079ba5ead63bf657ccef Mon Sep 17 00:00:00 2001 From: bMancone Date: Wed, 28 Dec 2011 16:43:15 +0000 Subject: [PATCH] // updated getSupplyOrderByReference --- classes/stock/SupplyOrder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/stock/SupplyOrder.php b/classes/stock/SupplyOrder.php index c16668ef2..e5f1ce195 100755 --- a/classes/stock/SupplyOrder.php +++ b/classes/stock/SupplyOrder.php @@ -432,6 +432,7 @@ class SupplyOrderCore extends ObjectModel /** * For a given id or reference, tells if the supply order exists * @param int|string $match + * @return int id */ public static function exists($match) { @@ -464,6 +465,9 @@ class SupplyOrderCore extends ObjectModel $query->where('so.reference = "'.pSQL($match).'"'); $id = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query); + if ($id === false) + return false; + return (new SupplyOrder((int)$id)); }