// Format definitions

This commit is contained in:
rMalie
2011-12-12 21:06:59 +00:00
parent 568fca377c
commit 39b9c7cfa1
13 changed files with 171 additions and 413 deletions
+17 -38
View File
@@ -101,21 +101,26 @@ class CartCore extends ObjectModel
'table' => 'cart',
'primary' => 'id_cart',
'fields' => array(
'id_address_delivery' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId'),
'id_carrier' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId'),
'id_address_invoice' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId'),
'id_currency' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
'id_customer' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId'),
'id_guest' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId'),
'id_lang' => array('type' => 'FILL_ME', 'validate' => 'isUnsignedId', 'required' => true),
'recyclable' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
'gift' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
'gift_message' => array('type' => 'FILL_ME', 'validate' => 'isMessage'),
'allow_seperated_package' => array('type' => 'FILL_ME', 'validate' => 'isBool'),
'id_group_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_address_delivery' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_address_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_carrier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_guest' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'recyclable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'gift' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'gift_message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage'),
'delivery_option' => array('type' => self::TYPE_STRING),
'secure_key' => array('type' => self::TYPE_STRING, 'size' => 32),
'allow_seperated_package' =>array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
),
);
protected $webserviceParameters = array(
'fields' => array(
'id_address_delivery' => array('xlink_resource' => 'addresses'),
@@ -143,32 +148,6 @@ class CartCore extends ObjectModel
const ONLY_WRAPPING = 6;
const ONLY_PRODUCTS_WITHOUT_SHIPPING = 7;
public function getFields()
{
$this->validateFields();
$fields['id_group_shop'] = (int)$this->id_group_shop;
$fields['id_shop'] = (int)$this->id_shop;
$fields['id_address_delivery'] = (int)$this->id_address_delivery;
$fields['id_address_invoice'] = (int)$this->id_address_invoice;
$fields['id_currency'] = (int)$this->id_currency;
$fields['id_customer'] = (int)$this->id_customer;
$fields['id_carrier'] = (int)$this->id_carrier;
$fields['id_guest'] = (int)$this->id_guest;
$fields['id_lang'] = (int)$this->id_lang;
$fields['recyclable'] = (int)$this->recyclable;
$fields['gift'] = (int)$this->gift;
$fields['secure_key'] = pSQL($this->secure_key);
$fields['gift_message'] = pSQL($this->gift_message);
$fields['date_add'] = pSQL($this->date_add);
$fields['date_upd'] = pSQL($this->date_upd);
$fields['allow_seperated_package'] = (int)$this->allow_seperated_package;
$fields['delivery_option'] = $this->delivery_option;
return $fields;
}
public function __construct($id = null, $id_lang = null)
{
parent::__construct($id, $id_lang);