public function getFields() { if (parent::validateFields()) { ShopgateLogger::getInstance()->log('Validation for shopgate database fields invalid', ShopgateLogger::LOGTYPE_ERROR); } if ($this->shopgate_order instanceof ShopgateOrder) { $this->shopgate_order = pSQL(base64_encode(serialize($this->shopgate_order))); } if (is_array($this->comments)) { if (method_exists("Tools", "jsonEncode")) { $encodedData = Tools::jsonEncode($this->comments); } else { $encodedData = json_encode($this->comments); } $this->comments = pSQL(base64_encode($encodedData)); } else { $this->comments = pSQL($this->comments); } $fields = array(); $fields['id_cart'] = (int) $this->id_cart; $fields['id_order'] = (int) $this->id_order; $fields['shopgate_order'] = pSQL(base64_encode(serialize($this->shopgate_order))); $fields['order_number'] = pSQL($this->order_number); $fields['shipping_service'] = pSQL($this->shipping_service); $fields['shipping_cost'] = (double) $this->shipping_cost; $fields['shop_number'] = pSQL($this->shop_number); $fields['comments'] = $this->comments; $fields['status'] = (int) $this->status; $fields['tracking_number'] = pSQL($this->tracking_number); $fields['is_sent_to_shopgate'] = (int) $this->is_sent_to_shopgate; return $fields; }