-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMeestExpress_Shipment.class.php
202 lines (157 loc) · 4.8 KB
/
MeestExpress_Shipment.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?php
/**
* Объект "отправки" Meest Express.
* Класс-массив (обертка)
*
* @author Maxim Miroshnichenko <[email protected]>
* @copyright WebProduction
* @package MeestExpress
*/
class MeestExpress_Shipment extends ArrayObject {
public function __construct(MeestExpress_API $api) {
$this->_api = $api;
}
public function getOrderID() {
return @$this['orderID'];
}
public function setOrderID($orderID) {
$this['orderID'] = $orderID;
}
public function getSenderName() {
return @$this['sendername'];
}
public function setSenderName($name) {
$this['sendername'] = $name;
}
public function getSenderService() {
return (int) @$this['senderservice'];
}
public function setSenderService($service) {
$this['senderservice'] = (int) $service;
}
public function getSenderStreetUID() {
return @$this['senderstreetuid'];
}
public function setSenderAddress($country, $city, $street, $house, $flat) {
$countryUID = $this->_getAPI()->getCountryUID($country);
$cityUID = $this->_getAPI()->getCityUID($city, $countryUID);
$this['senderstreetuid'] = $this->_getAPI()->getSteetUID($street, $cityUID);
$this['senderhouse'] = $house;
$this['senderflat'] = $flat;
}
public function getSenderHouse() {
return @$this['senderhouse'];
}
public function getSenderFlat() {
return @$this['senderflat'];
}
public function getSenderPhone() {
return @$this['senderphone'];
}
public function setSenderPhone($phone) {
$this['senderphone'] = $phone;
}
public function getReceiverName() {
return @$this['receivername'];
}
public function setReceiverName($name) {
$this['receivername'] = $name;
}
public function getReceiverService() {
return (int) @$this['receiverservice'];
}
public function setReceiverService($service) {
$this['receiverservice'] = (int) $service;
}
public function getReceiverStreetUID() {
return @$this['receiverstreetuid'];
}
public function setReceiverAddress($country, $city, $street, $house, $flat, $floor = 1) {
$countryUID = $this->_getAPI()->getCountryUID($country);
$cityUID = $this->_getAPI()->getCityUID($city, $countryUID);
$this['receiverstreetuid'] = $this->_getAPI()->getSteetUID($street, $cityUID);
$this['receiverhouse'] = $house;
$this['receiverflat'] = $flat;
$this['receiverfloor'] = $floor;
}
public function getReceiverHouse() {
return @$this['receiverhouse'];
}
public function getReceiverFlat() {
return @$this['receiverflat'];
}
public function getReceiverFloor() {
return @$this['receiverfloor'];
}
public function getReceiverPhone() {
return @$this['receiverphone'];
}
public function setReceiverPhone($phone) {
$this['receiverphone'] = $phone;
}
public function getNotation() {
return @$this['notation'];
}
public function setNotation($notation) {
$this['notation'] = $notation;
}
public function getPayReceiver() {
return (int) @$this['payreceiver'];
}
public function setPayReceiver($service) {
$this['payreceiver'] = (int) $service;
}
public function getPayType() {
return (int) @$this['paytype'];
}
public function setPayType($type) {
$this['paytype'] = (int) $type;
}
public function getSendingFormat() {
return @$this['sendingformat'];
}
public function setSendingFormat($format) {
$this['sendingformat'] = $format;
}
public function getSendingQuantity() {
$x = (int) @$this['sendingquantity'];
if ($x <= 1) {
$x = 1;
}
return $x;
}
public function setSendingQuantity($count) {
$this['sendingquantity'] = (int) $count;
}
public function getSendingWeight() {
$x = (float) @$this['sendingweight'];
if ($x < 0) {
$x = 0.1;
}
return $x;
}
public function setSendingWeight($weight) {
$this['sendingweight'] = (float) $weight;
}
public function getSendingInsurance() {
return (int) @$this['sendinginsurance'];
}
public function setSendingInsurance($price) {
$this['sendinginsurance'] = (int) $price;
}
public function getDeliveryDate() {
return @$this['deliverydate'];
}
public function setDeliveryDate($date) {
$this['deliverydate'] = $date;
}
/**
* Получить API родителя
*
* @return MeestExpress_API
*/
private function _getAPI() {
return $this->_api;
}
private $_api;
}