Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Drupal\display_builder; |
6 | |
7 | use Drupal\Core\Form\FormStateInterface; |
8 | |
9 | /** |
10 | * Interface for island plugins with a form inside. |
11 | */ |
12 | interface IslandWithFormInterface { |
13 | |
14 | /** |
15 | * Get The form class for this Island. |
16 | * |
17 | * @return string |
18 | * The Class string |
19 | */ |
20 | public static function getFormClass(): string; |
21 | |
22 | /** |
23 | * This Island declare a form class. |
24 | * |
25 | * @return bool |
26 | * TRUE if Island has form class, FALSE otherwise. |
27 | */ |
28 | public static function hasFormClass(): bool; |
29 | |
30 | /** |
31 | * Form constructor. |
32 | * |
33 | * @param array $form |
34 | * An associative array containing the structure of the form. |
35 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
36 | * The current state of the form. |
37 | */ |
38 | public function buildForm(array &$form, FormStateInterface $form_state): void; |
39 | |
40 | /** |
41 | * Form validation handler. |
42 | * |
43 | * @param array $form |
44 | * An associative array containing the structure of the form. |
45 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
46 | * The current state of the form. |
47 | */ |
48 | public function validateForm(array &$form, FormStateInterface $form_state): void; |
49 | |
50 | /** |
51 | * Form submission handler. |
52 | * |
53 | * @param array $form |
54 | * An associative array containing the structure of the form. |
55 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
56 | * The current state of the form. |
57 | */ |
58 | public function submitForm(array &$form, FormStateInterface $form_state): void; |
59 | |
60 | /** |
61 | * Alter form element after its built. |
62 | * |
63 | * @param array $element |
64 | * An associative array containing the structure of the form element. |
65 | * @param \Drupal\Core\Form\FormStateInterface $form_state |
66 | * The current state of the form. |
67 | * |
68 | * @return array |
69 | * The altered form element. |
70 | */ |
71 | public function afterBuild(array $element, FormStateInterface $form_state): array; |
72 | |
73 | /** |
74 | * Set builder id used for this plugin. |
75 | * |
76 | * @param string $builder_id |
77 | * The builder id. |
78 | */ |
79 | public function setBuilderId(string $builder_id): void; |
80 | |
81 | /** |
82 | * Set instance id used for this plugin. |
83 | * |
84 | * @param string|null $instance_id |
85 | * The instance id. |
86 | */ |
87 | public function setInstanceId(?string $instance_id): void; |
88 | |
89 | } |