[*] Classes: refactoring of ObjectModel::validateFields() && ObjectModel::validateFieldsLang()

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11273 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-12-15 16:19:55 +00:00
parent 7fcbd00819
commit deb4932850
4 changed files with 103 additions and 91 deletions
+1 -1
View File
@@ -243,7 +243,7 @@ class DiscountCore extends CartRule
$now = time();
$voucher->date_from = date('Y-m-d H:i:s', $now);
$voucher->date_to = date('Y-m-d H:i:s', $now + (3600 * 24 * 365.25)); /* 1 year */
if (!$voucher->validateFieldsLang(false) OR !$voucher->add())
if (!$voucher->validateFieldsLang(false) || !$voucher->add())
return false;
// set correct name
$voucher->name = 'V'.(int)($voucher->id).'C'.(int)($order->id_customer).'O'.$order->id;