Total Complexity | 5 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class ElementForm extends BaseElement |
||
12 | { |
||
13 | use UserForm; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private static $table_name = 'ElementForm'; |
||
|
|||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private static $title = 'Form'; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private static $icon = 'dnadesign/silverstripe-elemental-userforms:images/form.svg'; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private static $controller_class = ElementFormController::class; |
||
34 | |||
35 | /** |
||
36 | * @return UserForm |
||
37 | */ |
||
38 | public function ElementForm() |
||
39 | { |
||
40 | $controller = new UserDefinedFormController($this); |
||
41 | $current = Controller::curr(); |
||
42 | |||
43 | if ($current && $current->getAction() == 'finished') { |
||
44 | return $controller->renderWith(UserDefinedFormController::class .'_ReceivedFormSubmission'); |
||
45 | } |
||
46 | |||
47 | $form = $controller->Form(); |
||
48 | $form->setFormAction( |
||
49 | Controller::join_links( |
||
50 | $current->Link(), |
||
51 | 'element', |
||
52 | $this->owner->ID, |
||
53 | 'Form' |
||
54 | ) |
||
55 | ); |
||
56 | |||
57 | return $form; |
||
58 | } |
||
59 | |||
60 | public function Link($action = null) |
||
72 | } |
||
73 | } |
||
74 |
This check marks private properties in classes that are never used. Those properties can be removed.