// Format definitions
This commit is contained in:
@@ -55,9 +55,6 @@ class OrderCarrierCore extends ObjectModel
|
||||
/** @var string Object creation date */
|
||||
public $date_add;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -65,38 +62,21 @@ class OrderCarrierCore extends ObjectModel
|
||||
'table' => 'order_carrier',
|
||||
'primary' => 'id_order_carrier',
|
||||
'fields' => array(
|
||||
'id_order_carrier' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId'),
|
||||
'id_order' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_carrier' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_order_invoice' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId'),
|
||||
'weight' => array('type' => 'FILL_ME', 'validate' => 'isFloat'),
|
||||
'shipping_cost_tax_excl' => array('type' => 'FILL_ME', 'validate' => 'isFloat'),
|
||||
'shipping_cost_tax_incl' => array('type' => 'FILL_ME', 'validate' => 'isFloat'),
|
||||
'tracking_number' => array('type' => 'FILL_ME', 'validate' => 'isAnything'),
|
||||
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_carrier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_order_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'weight' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||
'shipping_cost_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||
'shipping_cost_tax_incl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||
'tracking_number' => array('type' => self::TYPE_FLOAT, 'validate' => 'isAnything'),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
protected $webserviceParameters = array(
|
||||
'fields' => array(
|
||||
'id_order' => array('xlink_resource' => 'orders'),
|
||||
'id_carrier' => array('xlink_resource' => 'carriers'),
|
||||
),
|
||||
);
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
$this->validateFields();
|
||||
|
||||
$fields['id_order'] = (int)$this->id_order;
|
||||
$fields['id_carrier'] = (int)$this->id_carrier;
|
||||
$fields['id_order_invoice'] = (int)$this->id_order_invoice;
|
||||
$fields['weight'] = (float)$this->weight;
|
||||
$fields['shipping_cost_tax_excl'] = (float)$this->shipping_cost_tax_excl;
|
||||
$fields['shipping_cost_tax_incl'] = (float)$this->shipping_cost_tax_incl;
|
||||
$fields['tracking_number'] = pSQL(($this->tracking_number));
|
||||
$fields['date_add'] = pSQL($this->date_add);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user