-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddress.php
More file actions
68 lines (61 loc) · 1.51 KB
/
Address.php
File metadata and controls
68 lines (61 loc) · 1.51 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
<?php
namespace mekegi\geocoder;
class Address
{
public $plain;
public $country;
public $region;
public $city;
public $street;
public $house;
public $housing;
public $building;
public $apartment;
public $lat;
public $lon;
/**
*
* @param string $plain
* @param string $country
* @param string $region
* @param string $city
* @param string $street
* @param string $house
* @param string $housing
* @param string $building
* @param string $apartment
*/
function __construct($plain, $country = null, $region = null, $city = null, $street = null, $house = null,
$housing = null, $building = null, $apartment = null)
{
$this->plain = $plain;
$this->country = $country;
$this->region = $region;
$this->city = $city;
$this->street = $street;
$this->house = $house;
$this->housing = $housing;
$this->building = $building;
$this->apartment = $apartment;
}
/**
* @since 13.08.13 13:05
* @author Arsen Abdusalamov
* @return boolean
*/
public function isFull()
{
return $this->city && $this->street && $this->house;
}
/**
*
* @since 13.08.13 16:10
* @author Arsen Abdusalamov
* @return bool
*/
public function checkLocalTimeIsWork()
{
$currentHour = date('H', time() + Gmt::getMSKShiftTime($this->region)*3600);
return $currentHour < 20 && $currentHour > 9;
}
}