// updated getSupplyOrderByReference

This commit is contained in:
bMancone
2011-12-28 16:43:15 +00:00
parent e5eb476caf
commit c4e775bc8e
+4
View File
@@ -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));
}