3 namespace Drupal\devel_generate;
5 use Drupal\Component\Plugin\PluginInspectionInterface;
6 use Drupal\Core\Form\FormStateInterface;
9 * Base interface definition for "DevelGenerate" plugins.
11 * This interface details base wrapping methods that most DevelGenerate implementations
12 * will want to directly inherit from Drupal\devel_generate\DevelGenerateBase.
14 * DevelGenerate impementationa plugins should developing settingsForm() and generateElements()
15 * to achieve its own behaviour.
18 interface DevelGenerateBaseInterface extends PluginInspectionInterface {
21 * Returns the array of settings, including defaults for missing settings.
24 * The array of settings.
26 function getSetting($key);
29 * Returns the default settings for the plugin.
32 * The array of default setting values, keyed by setting names.
34 function getDefaultSettings();
37 * Returns the current settings for the plugin.
40 * The array of current setting values, keyed by setting names.
42 function getSettings();
45 * Returns the form for the plugin.
48 * The array of default setting values, keyed by setting names.
50 function settingsForm(array $form, FormStateInterface $form_state);
53 * Form validation handler.
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.
60 function settingsFormValidate(array $form, FormStateInterface $form_state);
63 * Execute the instructions in common for all DevelGenerate plugin
65 * @param array $values
66 * The input values from the settings form.
68 function generate(array $values);
71 * Responsible for validating Drush params.
73 * @Return an array of values ready to be used for generateElements()
75 function validateDrushParams($args);