[-] WS : Fix xlink
[*] WS : Add entity tax_rule_groups [*] WS : Fix ObjectModel issue [*] WS : Delete sqlId not used [*] WS : Fix entity configurations [*] WS : Fix entity translated_configurations
This commit is contained in:
+2
-2
@@ -95,8 +95,8 @@ class CountryCore extends ObjectModel
|
||||
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'),
|
||||
'id_zone' => array('xlink_resource'=> 'zones'),
|
||||
'id_currency' => array('xlink_resource'=> 'currencies'),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -851,7 +851,7 @@ abstract class ObjectModelCore
|
||||
$resource_parameters = array_merge_recursive($default_resource_parameters, $this->{$ws_params_attribute_name});
|
||||
|
||||
$required_fields = (isset(self::$fieldsRequiredDatabase[get_class($this)]) ? self::$fieldsRequiredDatabase[get_class($this)] : array());
|
||||
foreach ($this->definition['fields'] as $field_name => $details)
|
||||
foreach ($this->def['fields'] as $field_name => $details)
|
||||
{
|
||||
if (!isset($resource_parameters['fields'][$field_name]))
|
||||
$resource_parameters['fields'][$field_name] = array();
|
||||
@@ -910,6 +910,7 @@ abstract class ObjectModelCore
|
||||
WHERE 1 '.$sql_filter.'
|
||||
'.($sql_sort != '' ? $sql_sort : '').'
|
||||
'.($sql_limit != '' ? $sql_limit : '');
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,9 +36,24 @@ class TranslatedConfigurationCore extends Configuration
|
||||
'date_upd' => array('i18n' => true),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'configuration',
|
||||
'primary' => 'id_configuration',
|
||||
'multilang' => true,
|
||||
'fields' => array(
|
||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isConfigName', 'required' => true, 'size' => 32),
|
||||
'id_group_shop' => array('type' => self::TYPE_NOTHING, 'validate' => 'isUnsignedId'),
|
||||
'id_shop' => array('type' => self::TYPE_NOTHING, 'validate' => 'isUnsignedId'),
|
||||
'value' => array('type' => self::TYPE_STRING),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
),
|
||||
);
|
||||
|
||||
public function __construct($id = NULL, $id_lang = NULL)
|
||||
{
|
||||
$this->def = ObjectModel::getDefinition($this);
|
||||
// Check if the id configuration is set in the configuration_lang table.
|
||||
// Otherwise configuration is not set as translated configuration.
|
||||
if ($id !== null)
|
||||
|
||||
@@ -56,7 +56,7 @@ class TaxRuleCore extends ObjectModel
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'fields' => array(
|
||||
'id_tax_rules_group' => array('xlink_resource'=> 'tax_rules_group'),
|
||||
'id_tax_rules_group' => array('xlink_resource'=> 'tax_rule_groups'),
|
||||
'id_state' => array('xlink_resource'=> 'states'),
|
||||
'id_country' => array('xlink_resource'=> 'countries')
|
||||
),
|
||||
|
||||
@@ -41,10 +41,17 @@ class TaxRulesGroupCore extends ObjectModel
|
||||
'primary' => 'id_tax_rules_group',
|
||||
'fields' => array(
|
||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
|
||||
'active' => array('type' => self::TYPE_BOOL),
|
||||
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
),
|
||||
);
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'objectsNodeName' => 'tax_rule_groups',
|
||||
'objectNodeName' => 'tax_rule_group',
|
||||
'fields' => array(
|
||||
),
|
||||
);
|
||||
|
||||
protected static $_taxes = array();
|
||||
|
||||
public static function getTaxRulesGroups($only_active = true)
|
||||
|
||||
@@ -277,7 +277,8 @@ class WebserviceRequestCore
|
||||
'supply_order_histories' => array('description' => 'Supply Order Histories', 'class' => 'SupplyOrderHistory', 'forbidden_method' => array('PUT', 'POST', 'DELETE')),
|
||||
'supply_order_receipt_histories' => array('description' => 'Supply Order Receipt Histories', 'class' => 'SupplyOrderReceiptHistory', 'forbidden_method' => array('PUT', 'POST', 'DELETE')),
|
||||
'product_suppliers' => array('description' => 'Product Suppliers', 'class' => 'ProductSupplier', 'forbidden_method' => array('PUT', 'POST', 'DELETE')),
|
||||
'tax_rules' => array('description' => 'Tax rules entity', 'class' => 'TaxRule', 'forbidden_method' => array('PUT', 'POST', 'DELETE')),
|
||||
'tax_rules' => array('description' => 'Tax rules entity', 'class' => 'TaxRule'),
|
||||
'tax_rule_groups' => array('description' => 'Tax rule groups', 'class' => 'TaxRulesGroup'),
|
||||
);
|
||||
ksort($resources);
|
||||
return $resources;
|
||||
|
||||
Reference in New Issue
Block a user