1 | <?php |
||
30 | class PartialFormSubmission extends SubmittedForm |
||
31 | { |
||
32 | private static $table_name = 'PartialFormSubmission'; |
||
|
|||
33 | |||
34 | private static $db = [ |
||
35 | 'IsSend' => 'Boolean(false)', |
||
36 | 'TokenSalt' => 'Varchar(16)', |
||
37 | 'Token' => 'Varchar(16)', |
||
38 | ]; |
||
39 | |||
40 | private static $has_one = [ |
||
41 | 'UserDefinedForm' => UserDefinedForm::class |
||
42 | ]; |
||
43 | |||
44 | private static $has_many = [ |
||
45 | 'PartialFields' => PartialFieldSubmission::class |
||
46 | ]; |
||
47 | |||
48 | private static $cascade_deletes = [ |
||
49 | 'PartialFields' |
||
50 | ]; |
||
51 | |||
52 | /** |
||
53 | * @var array |
||
54 | */ |
||
55 | private static $summary_fields = [ |
||
56 | 'ID' => 'ID', |
||
57 | 'PartialLink' => 'Link', |
||
58 | 'Created' => 'Created', |
||
59 | 'LastEdited' => 'Last Edited', |
||
60 | ]; |
||
61 | |||
62 | public function getCMSFields() |
||
96 | |||
97 | public function getParent() |
||
101 | |||
102 | /** |
||
103 | * @param Member |
||
104 | * |
||
105 | * @return boolean|string |
||
106 | */ |
||
107 | public function canCreate($member = null, $context = []) |
||
115 | |||
116 | /** |
||
117 | * @param Member |
||
118 | * |
||
119 | * @return boolean|string |
||
120 | */ |
||
121 | public function canView($member = null) |
||
129 | |||
130 | /** |
||
131 | * @param Member |
||
132 | * |
||
133 | * @return boolean|string |
||
134 | */ |
||
135 | public function canEdit($member = null) |
||
143 | |||
144 | /** |
||
145 | * @param Member |
||
146 | * |
||
147 | * @return boolean|string |
||
148 | */ |
||
149 | public function canDelete($member = null) |
||
157 | |||
158 | /** |
||
159 | * Get the share link of the form |
||
160 | * |
||
161 | * @return string |
||
162 | * @throws \Exception |
||
163 | */ |
||
164 | public function getPartialLink() |
||
179 | |||
180 | /** |
||
181 | * Get the unique token for the share link |
||
182 | * |
||
183 | * @return bool|string|null |
||
184 | * @throws \Exception |
||
185 | */ |
||
186 | protected function getPartialToken() |
||
196 | |||
197 | /** |
||
198 | * Generate a new token |
||
199 | * |
||
200 | * @return bool|string |
||
201 | * @throws \Exception |
||
202 | */ |
||
203 | protected function generateToken() |
||
209 | |||
210 | /** |
||
211 | * Generate a key based on the share token salt |
||
212 | * |
||
213 | * @param string $token |
||
214 | * @return mixed |
||
215 | */ |
||
216 | public function generateKey($token) |
||
220 | } |
||
221 |