/
Atm.php
203 lines (160 loc) · 6.15 KB
/
Atm.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
203
<?php
class App_Model_Atm{
protected $_id;
protected $_bank_id;
protected $_atm_network_id;
protected $_latitude;
protected $_longitude;
protected $_descriptive_location;
protected $_languages;
protected $_card_usage;
protected $_charges;
protected $_one_time_withdraw_limit;
protected $_additional_property;
protected $_description;
protected $_verification_description;
public function __construct(array $options = null){
if(is_array($options)){
$this->setOptions($options);
}
}
public function __set($name, $value)
{
$method = 'set' . $name;
if (('mapper' == $name) || !method_exists($this, $method)) {
throw new Exception('Invalid property');
}
$this->$method($value);
}
public function __get($name)
{
$method = 'get' . $name;
if (('mapper' == $name) || !method_exists($this, $method)) {
throw new Exception('Invalid property');
}
return $this->$method();
}
public function setOptions(array $options){
$methods=get_class_methods($this);
foreach($options as $key => $value){
$method='set'.ucfirst($key);
if(in_array($method,$methods)){
$this->$method($value);
}
}
return $this;
}
public function setVerificationDescription($data){
$this->_verification_description=(string)$data;
return $this;
}
public function getVerificationDescription(){
return $this->_verification_description;
}
public function setDescription($data){
$this->_description=(string)$data;
return $this;
}
public function getDescription(){
return $this->_description;
}
public function setAdditionalProperty($data){
$this->_additional_property=(string)$data;
return $this;
}
public function getAdditionalProperty(){
return $this->_additional_property;
}
public function setOneTimeWithdrawLimit($data){
$this->_one_time_withdraw_limit=(string)$data;
return $this;
}
public function getOneTimeWithdrawLimit(){
return $this->_one_time_withdraw_limit;
}
public function setCharges($data){
$this->_charges=(string)$data;
return $this;
}
public function getCharges(){
return $this->_charges;
}
public function setCardUsage($data){
$this->_card_usage=(string)$data;
return $this;
}
public function getCardUsage(){
return $this->_card_usage;
}
public function setLanguages($data){
$this->_languages=(string)$data;
return $this;
}
public function getLanguages(){
return $this->_languages;
}
public function setDescriptiveLocation($data){
$this->_descriptive_location=(string)$data;
return $this;
}
public function getDescriptiveLocation(){
return $this->_descriptive_location;
}
public function setLongitude($data){
$this->_longitude=(string)$data;
return $this;
}
public function getLongitude(){
return $this->_longitude;
}
public function setLatitude($data){
$this->_latitude=(string)$data;
return $this;
}
public function getLatitude(){
return $this->_latitude;
}
public function setAtmNetworkId($data){
$this->_atm_network_id=(string)$data;
return $this;
}
public function getAtmNetworkId(){
return $this->_atm_network_id;
}
public function setBankId($data){
$this->_bank_id=(string)$data;
return $this;
}
public function getBankId(){
return $this->_bank_id;
}
public function setId($data){
$this->_id=(string)$data;
return $this;
}
public function getId(){
return $this->_id;
}
public function find($id){
$mapper=new App_Model_AtmMapper();
$mapper->find($id,$this);
}
public function toArray(){
$row=array(
'Id' =>$this->getId(),
'BankId' =>$this->getBankId(),
'AtmNetworkId' =>$this->getAtmNetworkId(),
'Latitude' =>$this->getLatitude(),
'Longitude' =>$this->getLongitude(),
'DescriptiveLocation' =>$this->getDescriptiveLocation(),
'Languages' =>$this->getLanguages(),
'CardUsage' =>$this->getCardUsage(),
'Charges' =>$this->getCharges(),
'OneTimeWithdrawLimit' =>$this->getOneTimeWithdrawLimit(),
'AdditionalProperty' =>$this->getAdditionalProperty(),
'Description' =>$this->getDescription(),
'VerificationDescription' =>$this->getVerificationDescription(),
);
return $row;
}
}