From f7735427fcaf82c610eb90bdae8ba9fe38a17e76 Mon Sep 17 00:00:00 2001 From: bMancone Date: Wed, 28 Dec 2011 16:43:15 +0000 Subject: [PATCH] // updated getSupplyOrderByReference git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11870 b9a71923-0436-4b27-9f14-aed3839534dd --- 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)); }