1 | <?php |
||
19 | final class InverseFunctionalIdentifier |
||
20 | { |
||
21 | /** |
||
22 | * @var string A mailto IRI |
||
23 | */ |
||
24 | private $mbox; |
||
25 | |||
26 | /** |
||
27 | * @var string The SHA1 hash of a mailto IRI |
||
28 | */ |
||
29 | private $mboxSha1Sum; |
||
30 | |||
31 | /** |
||
32 | * @var string An openID uniquely identifying an Agent |
||
33 | */ |
||
34 | private $openId; |
||
35 | |||
36 | /** |
||
37 | * @var Account A user account on an existing system |
||
38 | */ |
||
39 | private $account; |
||
40 | |||
41 | /** |
||
42 | * Use on of the with*() factory methods to obtain an InverseFunctionalIdentifier |
||
43 | * instance. |
||
44 | */ |
||
45 | 15 | private function __construct() |
|
48 | |||
49 | 10 | public static function withMbox($mbox) |
|
56 | |||
57 | 6 | public static function withMboxSha1Sum($mboxSha1Sum) |
|
64 | |||
65 | public static function withOpenId($openId) |
||
72 | |||
73 | 3 | public static function withAccount($account) |
|
80 | |||
81 | /** |
||
82 | * Returns the mailto IRI. |
||
83 | * |
||
84 | * @return string The mailto IRI |
||
85 | */ |
||
86 | public function getMbox() |
||
90 | |||
91 | /** |
||
92 | * Returns the SHA1 hash of a mailto IRI. |
||
93 | * |
||
94 | * @return string The SHA1 hash of a mailto IRI |
||
95 | */ |
||
96 | public function getMboxSha1Sum() |
||
100 | |||
101 | /** |
||
102 | * Returns the openID. |
||
103 | * |
||
104 | * @return string The openID |
||
105 | */ |
||
106 | public function getOpenId() |
||
110 | |||
111 | /** |
||
112 | * Returns the user account of an existing system. |
||
113 | * |
||
114 | * @return Account The user account of an existing system |
||
115 | */ |
||
116 | public function getAccount() |
||
120 | |||
121 | /** |
||
122 | * Checks if another IRI is equal. |
||
123 | * |
||
124 | * Two inverse functional identifiers are equal if and only if all of their |
||
125 | * properties are equal. |
||
126 | * |
||
127 | * @param InverseFunctionalIdentifier $iri The iri to compare with |
||
128 | * |
||
129 | * @return bool True if the IRIs are equal, false otherwise |
||
130 | */ |
||
131 | 19 | public function equals(InverseFunctionalIdentifier $iri) |
|
159 | |||
160 | public function __toString() |
||
176 | } |
||
177 |