c2b814a2bc6c038e8537fa991603d4df624bd4d4
[yaffs-website] / web / modules / contrib / devel / devel_generate / src / DevelGenerateBaseInterface.php
1 <?php
2
3 namespace Drupal\devel_generate;
4
5 use Drupal\Component\Plugin\PluginInspectionInterface;
6 use Drupal\Core\Form\FormStateInterface;
7
8 /**
9  * Base interface definition for "DevelGenerate" plugins.
10  *
11  * This interface details base wrapping methods that most DevelGenerate implementations
12  * will want to directly inherit from Drupal\devel_generate\DevelGenerateBase.
13  *
14  * DevelGenerate impementationa plugins should developing settingsForm() and generateElements()
15  * to achieve its own behaviour.
16  *
17  */
18 interface DevelGenerateBaseInterface extends PluginInspectionInterface {
19
20   /**
21    * Returns the array of settings, including defaults for missing settings.
22    *
23    * @return array
24    *   The array of settings.
25    */
26   function getSetting($key);
27
28   /**
29    * Returns the default settings for the plugin.
30    *
31    * @return array
32    *   The array of default setting values, keyed by setting names.
33    */
34   function getDefaultSettings();
35
36   /**
37    * Returns the current settings for the plugin.
38    *
39    * @return array
40    *   The array of current setting values, keyed by setting names.
41    */
42   function getSettings();
43
44   /**
45    * Returns the form for the plugin.
46    *
47    * @return array
48    *   The array of default setting values, keyed by setting names.
49    */
50   function settingsForm(array $form, FormStateInterface $form_state);
51
52   /**
53    * Form validation handler.
54    *
55    * @param array $form
56    *   An associative array containing the structure of the form.
57    * @param \Drupal\Core\Form\FormStateInterface $form_state
58    *   The current state of the form.
59    */
60   function settingsFormValidate(array $form, FormStateInterface $form_state);
61
62   /**
63    * Execute the instructions in common for all DevelGenerate plugin
64    *
65    * @param array $values
66    *   The input values from the settings form.
67    */
68   function generate(array $values);
69
70   /**
71    * Responsible for validating Drush params.
72    *
73    * @Return an array of values ready to be used for generateElements()
74    */
75   function validateDrushParams($args);
76
77 }