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) |
||
40 | |||
41 | /** |
||
42 | * @return ContactType |
||
43 | */ |
||
44 | public static function administrative() |
||
48 | |||
49 | /** |
||
50 | * @return ContactType |
||
51 | */ |
||
52 | public static function billing() |
||
56 | |||
57 | /** |
||
58 | * @return ContactType |
||
59 | */ |
||
60 | public static function other() |
||
64 | |||
65 | /** |
||
66 | * @return ContactType |
||
67 | */ |
||
68 | public static function support() |
||
72 | |||
73 | /** |
||
74 | * @return ContactType |
||
75 | */ |
||
76 | public static function technical() |
||
80 | |||
81 | /** |
||
82 | * @return string |
||
83 | */ |
||
84 | public function getType() |
||
88 | |||
89 | /** |
||
90 | * @param ContactType $other |
||
91 | * @return bool |
||
92 | */ |
||
93 | public function equals(ContactType $other) |
||
97 | |||
98 | public function __toString() |
||
102 | } |
||
103 |