[+] Project : Vouchers are now replaced by cart rules
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9771 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+17
-41
@@ -25,47 +25,23 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class OrderDiscountCore extends ObjectModel
|
||||
class OrderDiscountCore extends OrderCartRule
|
||||
{
|
||||
/** @var integer */
|
||||
public $id_order_discount;
|
||||
|
||||
/** @var integer */
|
||||
public $id_order;
|
||||
|
||||
/** @var integer */
|
||||
public $id_discount;
|
||||
|
||||
/** @var string */
|
||||
public $name;
|
||||
|
||||
/** @var integer */
|
||||
public $value;
|
||||
|
||||
protected $tables = array ('order_discount');
|
||||
|
||||
protected $fieldsRequired = array ('id_order', 'name', 'value');
|
||||
protected $fieldsValidate = array ('id_order' => 'isUnsignedId', 'name' => 'isGenericName', 'value' => 'isInt');
|
||||
|
||||
/* MySQL does not allow 'order detail' for a table name */
|
||||
protected $table = 'order_discount';
|
||||
protected $identifier = 'id_order_discount';
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'fields' => array(
|
||||
'id_order' => array('xlink_resource' => 'orders'),
|
||||
),
|
||||
);
|
||||
|
||||
public function getFields()
|
||||
public function __get($key)
|
||||
{
|
||||
$this->validateFields();
|
||||
|
||||
$fields['id_order'] = (int)($this->id_order);
|
||||
$fields['name'] = pSQL($this->name);
|
||||
$fields['value'] = (int)($this->value);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
if ($key == 'id_order_discount')
|
||||
return $this->id_order_cart_rule;
|
||||
if ($key == 'id_discount')
|
||||
return $this->id_cart_rule;
|
||||
return $this->{$key};
|
||||
}
|
||||
|
||||
public function __set($key, $value)
|
||||
{
|
||||
if ($key == 'id_order_discount')
|
||||
$this->id_order_cart_rule = $value;
|
||||
if ($key == 'id_discount')
|
||||
$this->id_cart_rule = $value;
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user