1 | <?php |
||
10 | final class EventStatusType |
||
11 | { |
||
12 | private const SCHEDULED = 'EventScheduled'; |
||
13 | private const POSTPONED = 'EventPostponed'; |
||
14 | private const CANCELLED = 'EventCancelled'; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $value; |
||
20 | |||
21 | /** |
||
22 | * @var string[] |
||
23 | */ |
||
24 | private const ALLOWED_VALUES = [ |
||
25 | self::SCHEDULED, |
||
26 | self::POSTPONED, |
||
27 | self::CANCELLED, |
||
28 | ]; |
||
29 | |||
30 | private function __construct(string $value) |
||
37 | |||
38 | public static function scheduled(): EventStatusType |
||
42 | |||
43 | public static function postponed(): EventStatusType |
||
47 | |||
48 | public static function cancelled(): EventStatusType |
||
52 | |||
53 | public function toNative(): string |
||
57 | |||
58 | public static function fromNative(string $value): EventStatusType |
||
62 | |||
63 | public function equals(EventStatusType $status): bool |
||
67 | } |
||
68 |