1 | <?php |
||
5 | class GenericState |
||
6 | { |
||
7 | private $className; |
||
8 | |||
9 | private $code; |
||
10 | |||
11 | private $fullName; |
||
12 | |||
13 | private $shortName; |
||
14 | |||
15 | private $timeZone; |
||
16 | |||
17 | /** |
||
18 | * GenericState constructor. |
||
19 | * |
||
20 | * @param int $code |
||
21 | * @param string $fullName |
||
22 | * @param string $shortName |
||
23 | * @param string $timeZone |
||
24 | */ |
||
25 | 1 | public function __construct($code, $fullName, $shortName, $timeZone) |
|
26 | { |
||
27 | 1 | $this->className = $this->normalizeClassName($fullName); |
|
28 | 1 | $this->code = (int) $code; |
|
29 | 1 | $this->fullName = $fullName; |
|
30 | 1 | $this->shortName = $shortName; |
|
31 | 1 | $this->timeZone = $timeZone; |
|
32 | 1 | } |
|
33 | |||
34 | 1 | private function normalizeClassName($fullName) |
|
35 | { |
||
36 | 1 | $ascName = iconv('utf-8', 'ascii//TRANSLIT', $fullName); |
|
37 | 1 | $className = str_replace(' ', '', ucwords($ascName)); |
|
38 | |||
39 | 1 | return $className; |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | public function getClassName() |
||
49 | |||
50 | /** |
||
51 | * @return int |
||
52 | */ |
||
53 | 1 | public function getCode() |
|
54 | { |
||
55 | 1 | return $this->code; |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return string |
||
60 | */ |
||
61 | public function getFullName() |
||
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | */ |
||
69 | public function getShortName() |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getTimeZone() |
||
81 | |||
82 | /** |
||
83 | * @return bool |
||
84 | */ |
||
85 | 1 | public function isState() |
|
89 | } |
||
90 |