1 | <?php |
||
8 | class Status |
||
9 | { |
||
10 | /** |
||
11 | * Value representing unknown state. |
||
12 | */ |
||
13 | const UNKNOWN = 'UNKNOWN'; |
||
14 | |||
15 | /** |
||
16 | * Value representing up state. |
||
17 | */ |
||
18 | const UP = 'UP'; |
||
19 | |||
20 | /** |
||
21 | * Value representing down state. |
||
22 | */ |
||
23 | const DOWN = 'DOWN'; |
||
24 | |||
25 | /** |
||
26 | * Value representing out-of-service state. |
||
27 | */ |
||
28 | const OUT_OF_SERVICE = 'OUT_OF_SERVICE'; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $code; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $description; |
||
39 | |||
40 | /** |
||
41 | * Create a new Status instance with the given code and description. |
||
42 | * |
||
43 | * @param string $code |
||
44 | * @param string $description |
||
45 | */ |
||
46 | public function __construct($code, $description = '') |
||
53 | 111 | ||
54 | 111 | /** |
|
55 | * Return the code for this status. |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getCode() |
||
63 | 42 | ||
64 | /** |
||
65 | * Return the description of this status. |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | public function getDescription() |
||
73 | 3 | ||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | public function __toString() |
||
81 | } |
||
82 |