// Format definitions
This commit is contained in:
+20
-43
@@ -64,22 +64,6 @@ class CountryCore extends ObjectModel
|
||||
|
||||
protected static $_idZones = array();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'objectsNodeName' => 'countries',
|
||||
'fields' => array(
|
||||
'id_zone' => array('sqlId' => 'id_zone', 'xlink_resource'=> 'zones'),
|
||||
'id_currency' => array('sqlId' => 'id_currency', 'xlink_resource'=> 'currencies'),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -88,36 +72,29 @@ class CountryCore extends ObjectModel
|
||||
'primary' => 'id_country',
|
||||
'multilang' => true,
|
||||
'fields' => array(
|
||||
'id_zone' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_currency' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId'),
|
||||
'call_prefix' => array('type' => 'FILL_ME', 'validate' => 'isInt'),
|
||||
'iso_code' => array('type' => 'FILL_ME', 'validate' => 'isLanguageIsoCode', 'required' => true, 'size' => 3),
|
||||
'active' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
|
||||
'contains_states' => array('type' => 'FILL_ME', 'validate' => 'isBool', 'required' => true),
|
||||
'need_identification_number' => array('type' => 'FILL_ME', 'validate' => 'isBool', 'required' => true),
|
||||
'need_zip_code' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
|
||||
'zip_code_format' => array('type' => 'FILL_ME', 'validate' => 'isZipCodeFormat'),
|
||||
'display_tax_label' => array('type' => 'FILL_ME', 'validate' => 'isBool', 'required' => true),
|
||||
'name' => array('type' => 'FILL_ME', 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
|
||||
'id_zone' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'call_prefix' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
||||
'iso_code' => array('type' => self::TYPE_STRING, 'validate' => 'isLanguageIsoCode', 'required' => true, 'size' => 3),
|
||||
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'contains_states' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true),
|
||||
'need_identification_number' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true),
|
||||
'need_zip_code' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'zip_code_format' => array('type' => self::TYPE_STRING, 'validate' => 'isZipCodeFormat'),
|
||||
'display_tax_label' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true),
|
||||
|
||||
// Lang fields
|
||||
'name' => array('type' => 'FILL_ME', 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
$fields['id_zone'] = (int)$this->id_zone;
|
||||
$fields['id_currency'] = (int)$this->id_currency;
|
||||
$fields['iso_code'] = pSQL(strtoupper($this->iso_code));
|
||||
$fields['call_prefix'] = (int)$this->call_prefix;
|
||||
$fields['active'] = (int)$this->active;
|
||||
$fields['contains_states'] = (int)$this->contains_states;
|
||||
$fields['need_identification_number'] = (int)$this->need_identification_number;
|
||||
$fields['need_zip_code'] = (int)$this->need_zip_code;
|
||||
$fields['zip_code_format'] = $this->zip_code_format;
|
||||
$fields['display_tax_label'] = $this->display_tax_label;
|
||||
return $fields;
|
||||
}
|
||||
protected $webserviceParameters = array(
|
||||
'objectsNodeName' => 'countries',
|
||||
'fields' => array(
|
||||
'id_zone' => array('sqlId' => 'id_zone', 'xlink_resource'=> 'zones'),
|
||||
'id_currency' => array('sqlId' => 'id_currency', 'xlink_resource'=> 'currencies'),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Check then return multilingual fields for database interaction
|
||||
|
||||
Reference in New Issue
Block a user