PluginProbe
MBE eShip / trunk
MBE eShip vtrunk
2.8.1 trunk 1.0.0 1.1.0 1.1.3 1.2.1 1.2.2 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.7.1 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.1.0 2.1.1 2.1.2 2.2.1 All 37 releases
mail-boxes-etc / lib / Model / CsvShipping.php

CsvShipping.php in MBE eShip trunk, at lib/Model/CsvShipping.php

52 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Mbe_Shipping_Model_Csv_Shipping implements Mbe_Shipping_Entity_Model_Interface
4 {
5 use \Traits\Mbe_Entity_Model_Trait {
6 insertRow as protected traitInserRow;
7 truncate as protected traitTruncate;
8 tableExists as protected traitTableExists;
9 insertRow as protected traitInsertRow;
10 updateRow as protected traitUpdateRow;
11 }
12
13 public function tableExists() {
14 return $this->traitTableExists($this->getTableName());
15 }
16
17 public function truncate() {
18 return $this->traitTruncate($this->getTableName());
19 }
20
21 public function insertRow($row ) {
22 return $this->traitInserRow($this->getTableName(), $row);
23 }
24
25 public function updateRow($id, $row ) {
26 return $this->traitUpdateRow($this->getTableName(), $id, $row);
27 }
28
29 public function getTableName() {
30 global $wpdb;
31 return $wpdb->prefix . Mbe_Shipping_Helper_Data::MBE_CSV_RATES_TABLE_NAME;
32 }
33
34 public function getSqlCreate() {
35 global $wpdb;
36 $charset = $wpdb->get_charset_collate();
37
38 return "CREATE TABLE " . $this->getTableName() . " (
39 id_mbeshippingrate int(10) unsigned NOT NULL AUTO_INCREMENT,
40 country varchar(4) NOT NULL DEFAULT '',
41 region varchar(10) NOT NULL DEFAULT '',
42 city varchar(30) NOT NULL DEFAULT '',
43 zip varchar(10) NOT NULL DEFAULT '',
44 zip_to varchar(10) NOT NULL DEFAULT '',
45 weight_from decimal(12,4) NOT NULL DEFAULT 0,
46 weight_to decimal(12,4) NOT NULL DEFAULT 0,
47 price decimal(12,4) DEFAULT 0,
48 delivery_type varchar(255) DEFAULT '',
49 PRIMARY KEY (id_mbeshippingrate)
50 ) $charset;";
51 }
52 }