| 1 |
<?php |
| 2 |
|
| 3 |
class Mbe_Shipping_Model_Csv_Pickup_Address 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_PICKUP_ADDRESSES_TABLE_NAME; |
| 32 |
} |
| 33 |
|
| 34 |
public function getSqlCreate() { // Not used at the moment |
| 35 |
global $wpdb; |
| 36 |
$charset = $wpdb->get_charset_collate(); |
| 37 |
|
| 38 |
return "CREATE TABLE " . $this->getTableName() . " ( |
| 39 |
id int(10) unsigned auto_increment , |
| 40 |
pickup_address_id varchar(256) DEFAULT '', |
| 41 |
trade_name varchar(256) NOT NULL DEFAULT '', |
| 42 |
address_1 varchar(256) NOT NULL DEFAULT '', |
| 43 |
address_2 varchar(256) NOT NULL DEFAULT '', |
| 44 |
address_3 varchar(256) NOT NULL DEFAULT '', |
| 45 |
zip_code varchar(10) NOT NULL DEFAULT '', |
| 46 |
city varchar(30) NOT NULL DEFAULT '', |
| 47 |
province varchar(10) NOT NULL DEFAULT '', |
| 48 |
country varchar(4) NOT NULL DEFAULT '', |
| 49 |
reference varchar(50) NOT NULL DEFAULT '', |
| 50 |
phone_1 varchar(50) NOT NULL DEFAULT '', |
| 51 |
phone_2 varchar(50) NOT NULL DEFAULT '', |
| 52 |
email_1 varchar(256) NOT NULL DEFAULT '', |
| 53 |
email_2 varchar(256) NOT NULL DEFAULT '', |
| 54 |
fax varchar(50) NOT NULL DEFAULT '', |
| 55 |
res boolean DEFAULT false, |
| 56 |
mmr boolean DEFAULT false, |
| 57 |
ltz boolean DEFAULT false, |
| 58 |
is_default boolean DEFAULT false, |
| 59 |
primary key (id) |
| 60 |
) $charset;"; |
| 61 |
} |
| 62 |
|
| 63 |
} |