// Format definitions

This commit is contained in:
rMalie
2011-12-13 13:41:54 +00:00
parent a40f3c304c
commit c022f4e0e5
71 changed files with 710 additions and 1791 deletions
+9 -31
View File
@@ -39,9 +39,6 @@ class SpecificPriceRuleCore extends ObjectModel
public $from;
public $to;
/**
* @see ObjectModel::$definition
*/
@@ -49,37 +46,18 @@ class SpecificPriceRuleCore extends ObjectModel
'table' => 'specific_price_rule',
'primary' => 'id_specific_price_rule',
'fields' => array(
'id_shop' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
'id_country' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
'id_group' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
'from_quantity' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedInt', 'required' => true),
'reduction' => array('type' => 'FILL_ME', 'validate' => 'isPrice', 'required' => true),
'reduction_type' => array('type' => 'FILL_ME', 'validate' => 'isReductionType', 'required' => true),
'from' => array('type' => 'FILL_ME', 'validate' => 'isDateFormat', 'required' => true),
'to' => array('type' => 'FILL_ME', 'validate' => 'isDateFormat', 'required' => true),
'id_currency' => array('type' => 'FILL_ME', 'required' => true),
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'id_currency' => array('type' => self::TYPE_INT, 'required' => true),
'id_group' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'from_quantity' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true),
'reduction' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
'reduction_type' => array('type' => self::TYPE_STRING, 'validate' => 'isReductionType', 'required' => true),
'from' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'required' => true),
'to' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'required' => true),
),
);
public function getFields()
{
$this->validateFields();
$fields['name'] = pSQL($this->name);
$fields['id_shop'] = (int)$this->id_shop;
$fields['id_currency'] = (int)$this->id_currency;
$fields['id_country'] = (int)$this->id_country;
$fields['id_group'] = (int)$this->id_group;
$fields['from_quantity'] = (int)$this->from_quantity;
$fields['reduction'] = (float)$this->reduction;
$fields['reduction_type'] = pSQL($this->reduction_type);
$fields['from'] = pSQL($this->from);
$fields['to'] = pSQL($this->to);
return $fields;
}
public function delete()
{
$ids_condition_group = Db::getInstance()->executeS('SELECT id_specific_price_rule_condition_group