-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddress.php
More file actions
78 lines (68 loc) · 2.13 KB
/
address.php
File metadata and controls
78 lines (68 loc) · 2.13 KB
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
<?php
class Address {
// Properties
private $query;
private $postcode = 'N/A';
private $parish = 'N/A';
private $adminDistrict = 'N/A';
private $country = 'N/A';
private $longitude = 'N/A';
private $latitude = 'N/A';
function __construct() {
}
function buildAddressFromPostcodeApi($addressResponse, $query){
$this->set_query($query);
if ($addressResponse){
$this->set_postcode($addressResponse['postcode']);
$this->set_parish($addressResponse['parish']);
$this->set_adminDistrict($addressResponse['admin_district']);
$this->set_country($addressResponse['country']);
$this->set_longitude($addressResponse['longitude']);
$this->set_latitude($addressResponse['latitude']);
}
}
//Getters & Setters
function set_postcode($postcode) {
$this->postcode = $postcode;
}
function get_postcode() {
return $this->postcode;
}
function set_parish($parish) {
$this->parish = $parish;
}
function get_parish() {
return $this->parish;
}
function set_adminDistrict($adminDistrict) {
$this->adminDistrict = $adminDistrict;
}
function get_adminDistrict() {
return $this->adminDistrict;
}
function set_longitude($longitude) {
$this->longitude = $longitude;
}
function get_longitude() {
return $this->longitude;
}
function set_country($country) {
$this->country = $country;
}
function get_country() {
return $this->country;
}
function set_latitude($latitude) {
$this->latitude = $latitude;
}
function get_latitude() {
return $this->latitude;
}
function set_query($query) {
$this->query = $query;
}
function get_query() {
return $this->query;
}
}
?>