[*] Classes: Remove $fieldsRequired, $fieldsSize and $fieldsValidate (and lang properties) properties, use $definition instead
This commit is contained in:
+13
-5
@@ -43,17 +43,25 @@ class TaxCore extends ObjectModel
|
||||
/** @var string Account Number */
|
||||
public $account_number;
|
||||
|
||||
protected $fieldsRequired = array('rate');
|
||||
protected $fieldsValidate = array('rate' => 'isFloat');
|
||||
protected $fieldsRequiredLang = array('name');
|
||||
protected $fieldsSizeLang = array('name' => 32);
|
||||
protected $fieldsValidateLang = array('name' => 'isGenericName');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
public static $definition = array(
|
||||
'table' => 'tax',
|
||||
'primary' => 'id_tax',
|
||||
'fields' => array(
|
||||
'rate' => array('type' => 'FILL_ME', 'validate' => 'isFloat', 'required' => true),
|
||||
'name' => array('type' => 'FILL_ME', 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 32),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
protected static $_product_country_tax = array();
|
||||
protected static $_product_tax_via_rules = array();
|
||||
|
||||
|
||||
+16
-9
@@ -36,21 +36,28 @@ class TaxRuleCore extends ObjectModel
|
||||
public $behavior;
|
||||
public $description;
|
||||
|
||||
protected $fieldsRequired = array('id_tax_rules_group', 'id_country', 'id_tax');
|
||||
protected $fieldsValidate = array('id_tax_rules_group' => 'isUnsignedId',
|
||||
'id_country' => 'isUnsignedId',
|
||||
'id_state' => 'isUnsignedId',
|
||||
'zipcode_from' => 'isPostCode',
|
||||
'zipcode_to' => 'isPostCode',
|
||||
'id_tax' => 'isUnsignedId',
|
||||
'behavior' => 'isUnsignedInt',
|
||||
'description' => 'isString');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
public static $definition = array(
|
||||
'table' => 'tax_rule',
|
||||
'primary' => 'id_tax_rule',
|
||||
'fields' => array(
|
||||
'id_tax_rules_group' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_country' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_state' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId'),
|
||||
'zipcode_from' => array('type' => 'FILL_ME', 'validate' => 'isPostCode'),
|
||||
'zipcode_to' => array('type' => 'FILL_ME', 'validate' => 'isPostCode'),
|
||||
'id_tax' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'behavior' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedInt'),
|
||||
'description' => array('type' => 'FILL_ME', 'validate' => 'isString'),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
|
||||
@@ -33,15 +33,22 @@ class TaxRulesGroupCore extends ObjectModel
|
||||
/** @var bool active state */
|
||||
public $active;
|
||||
|
||||
protected $fieldsRequired = array('name');
|
||||
protected $fieldsSize = array('name' => 64);
|
||||
protected $fieldsValidate = array('name' => 'isGenericName');
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
public static $definition = array(
|
||||
'table' => 'tax_rules_group',
|
||||
'primary' => 'id_tax_rules_group',
|
||||
'fields' => array(
|
||||
'name' => array('type' => 'FILL_ME', 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
protected static $_taxes = array();
|
||||
|
||||
public function getFields()
|
||||
|
||||
Reference in New Issue
Block a user