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