1 | <?php |
||
7 | final class ContactType |
||
8 | { |
||
9 | const TYPE_ADMINISTRATIVE = 'administrative'; |
||
10 | const TYPE_BILLING = 'billing'; |
||
11 | const TYPE_OTHER = 'other'; |
||
12 | const TYPE_SUPPORT = 'support'; |
||
13 | const TYPE_TECHNICAL = 'technical'; |
||
14 | |||
15 | private static $validTypes = array( |
||
16 | self::TYPE_ADMINISTRATIVE, |
||
17 | self::TYPE_BILLING, |
||
18 | self::TYPE_OTHER, |
||
19 | self::TYPE_SUPPORT, |
||
20 | self::TYPE_TECHNICAL |
||
21 | ); |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $type; |
||
27 | |||
28 | /** |
||
29 | ** @param string $type one of the ContactType::TYPE_* constants |
||
30 | */ |
||
31 | public function __construct($type) |
||
38 | |||
39 | /** |
||
40 | * @return ContactType |
||
41 | */ |
||
42 | public static function administrative() |
||
46 | |||
47 | /** |
||
48 | * @return ContactType |
||
49 | */ |
||
50 | public static function billing() |
||
54 | |||
55 | /** |
||
56 | * @return ContactType |
||
57 | */ |
||
58 | public static function other() |
||
62 | |||
63 | /** |
||
64 | * @return ContactType |
||
65 | */ |
||
66 | public static function support() |
||
70 | |||
71 | /** |
||
72 | * @return ContactType |
||
73 | */ |
||
74 | public static function technical() |
||
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getType() |
||
86 | |||
87 | /** |
||
88 | * @param ContactType $other |
||
89 | * @return bool |
||
90 | */ |
||
91 | public function equals(ContactType $other) |
||
95 | |||
96 | public function __toString() |
||
100 | } |
||
101 |