1 | <?php |
||
28 | class FormIdentifierObject |
||
29 | { |
||
30 | /** |
||
31 | * This is the full hash used to retrieve this form identifier data. It can |
||
32 | * be passed to another request. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $identifierHash; |
||
37 | |||
38 | /** |
||
39 | * Contains the class name of the form. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $className; |
||
44 | |||
45 | /** |
||
46 | * This is the form identifier, in most cases it will be the uid of the form |
||
47 | * if it is an instance of `DomainObjectInterface`. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $identifier; |
||
52 | |||
53 | /** |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $uniqueHash; |
||
57 | |||
58 | /** |
||
59 | * @var FormObject |
||
60 | */ |
||
61 | protected $formObject; |
||
62 | |||
63 | /** |
||
64 | * @param FormObject $formObject |
||
65 | */ |
||
66 | public function __construct(FormObject $formObject) |
||
70 | |||
71 | /** |
||
72 | * Will decrypt and parse the given hash. The data should be an array |
||
73 | * containing the following information: |
||
74 | * |
||
75 | * - `c` - the class name of the form (required) |
||
76 | * - `h` - the unique hash of the form (required) |
||
77 | * - `i` - the identifier of the form |
||
78 | * |
||
79 | * @param string $hash |
||
80 | * @throws WrongFormIdentifierObjectDataException |
||
81 | * @internal |
||
82 | */ |
||
83 | public function analyzeIdentifierHash($hash) |
||
116 | |||
117 | /** |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getIdentifierHash() |
||
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getClassName() |
||
138 | |||
139 | /** |
||
140 | * @return string |
||
141 | */ |
||
142 | public function getIdentifier() |
||
146 | |||
147 | /** |
||
148 | * @return bool |
||
149 | */ |
||
150 | public function hasIdentifier() |
||
154 | |||
155 | /** |
||
156 | * @return string |
||
157 | */ |
||
158 | public function getUniqueHash() |
||
162 | |||
163 | /** |
||
164 | * @return array |
||
165 | */ |
||
166 | protected function getFormIdentifierData() |
||
188 | } |
||
189 |